Maybe it is a good idea to separate the data validation rules from the data transformation rules.
For example, CDefaultValueValidator and CFilterValidator are not validators.
This may cause a problem with the order of execution, though.
Please comment.
Page 1 of 1
Separated validation and transformation rules
#1
Posted 23 February 2012 - 09:38 AM
Rodrigo Coelho
Check my extension
giix: a code generator for Yii.
The complete beginner's study guide for the Yii Framework
Check my extension
giix: a code generator for Yii.

The complete beginner's study guide for the Yii Framework
#3
Posted 23 February 2012 - 12:14 PM
Clarity would be a good additional benefit, but it is not the main purpose.
This change would be useful in cases you don't want to run the (real) validation, but you still depend on some transformations to get the information from a temporary atribute and format to a definitive attribute and format for later model use or AR storage.
Having a scenario, a setter or a custom onBeforeSave event handler could be an easy fix for this, though.
This change would be useful in cases you don't want to run the (real) validation, but you still depend on some transformations to get the information from a temporary atribute and format to a definitive attribute and format for later model use or AR storage.
Having a scenario, a setter or a custom onBeforeSave event handler could be an easy fix for this, though.
Rodrigo Coelho
Check my extension
giix: a code generator for Yii.
The complete beginner's study guide for the Yii Framework
Check my extension
giix: a code generator for Yii.

The complete beginner's study guide for the Yii Framework
#4
Posted 24 February 2012 - 09:06 PM
Yeah. My first thought was describe rules for "filter" scenario and then validate just this scenario.
Share this topic:
Page 1 of 1

Help
This topic is locked












