|
|
@ -117,7 +117,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess |
|
|
|
* ~~~ |
|
|
|
* ~~~ |
|
|
|
* |
|
|
|
* |
|
|
|
* In the above `$attribute` refers to currently validated attribute name while `$params` contains an array of |
|
|
|
* In the above `$attribute` refers to currently validated attribute name while `$params` contains an array of |
|
|
|
* validator configuration options such as `max` in case of `length` validator. Currently validate attribute value |
|
|
|
* validator configuration options such as `max` in case of `string` validator. Currently validate attribute value |
|
|
|
* can be accessed as `$this->[$attribute]`. |
|
|
|
* can be accessed as `$this->[$attribute]`. |
|
|
|
* |
|
|
|
* |
|
|
|
* Yii also provides a set of [[Validator::builtInValidators|built-in validators]]. |
|
|
|
* Yii also provides a set of [[Validator::builtInValidators|built-in validators]]. |
|
|
@ -129,8 +129,8 @@ class Model extends Component implements IteratorAggregate, ArrayAccess |
|
|
|
* array( |
|
|
|
* array( |
|
|
|
* // built-in "required" validator |
|
|
|
* // built-in "required" validator |
|
|
|
* array('username', 'required'), |
|
|
|
* array('username', 'required'), |
|
|
|
* // built-in "length" validator customized with "min" and "max" properties |
|
|
|
* // built-in "string" validator customized with "min" and "max" properties |
|
|
|
* array('username', 'length', 'min' => 3, 'max' => 12), |
|
|
|
* array('username', 'string', 'min' => 3, 'max' => 12), |
|
|
|
* // built-in "compare" validator that is used in "register" scenario only |
|
|
|
* // built-in "compare" validator that is used in "register" scenario only |
|
|
|
* array('password', 'compare', 'compareAttribute' => 'password2', 'on' => 'register'), |
|
|
|
* array('password', 'compare', 'compareAttribute' => 'password2', 'on' => 'register'), |
|
|
|
* // an inline validator defined via the "authenticate()" method in the model class |
|
|
|
* // an inline validator defined via the "authenticate()" method in the model class |
|
|
|