Difference between #29 and #30 of
Reference: Model rules validation

Changes

Title unchanged

Reference: Model rules validation

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

Form validation, model, validation, reference, validation rules, validator

Content changed

[...]
If this option is not set, the rule will be applied in any scenario.
See the section [Scenarios][#Scenarios] for details.
+ *message*: replaces the default error message if validation fails.
+ *...validation parameters...*: any number of extra parameters to be used by the specified validator.

**Note**: You may get into trouble when using model's attributes as additional parameters for validators. Take a look at: [https://github.com/yiisoft/yii/issues/3001](https://github.com/yiisoft/yii/issues/3001 "https://github.com/yiisoft/yii/issues/3001")
 

### Choice of validators
[...]
through the `"on" => "scenario"` parameter.


 
## Validation rules reference

For each rule, the list of its specific arguments is given with the eventual default value *(in italics)*.

### `boolean` : [CBooleanValidator]
Validates that the attribute value is either trueValue or falseValue.
[...]
99 0
114 followers
Viewed: 892 241 times
Version: 1.1
Category: How-tos
Written by: krillzip
Last updated by: Rodrigo
Created on: Nov 29, 2009
Last updated: 11 years ago
Update Article

Revisions

View all history