Commit 91e973ce by Carsten Brandt

note about validation rules order

fixes #2268
parent 6e6fc1ec
...@@ -97,6 +97,7 @@ When the `validate()` method is called, it does the following steps to perform v ...@@ -97,6 +97,7 @@ When the `validate()` method is called, it does the following steps to perform v
2. Determine which rules should be applied by checking the current [[yii\base\Model::scenario|scenario]] 2. Determine which rules should be applied by checking the current [[yii\base\Model::scenario|scenario]]
against the rules declared in [[yii\base\Model::rules()]]. These rules are the active rules. against the rules declared in [[yii\base\Model::rules()]]. These rules are the active rules.
3. Use each active rule to validate each active attribute which is associated with the rule. 3. Use each active rule to validate each active attribute which is associated with the rule.
The validation rules are evaluated in the order they are listed.
According to the above validation steps, an attribute will be validated if and only if it is According to the above validation steps, an attribute will be validated if and only if it is
an active attribute declared in `scenarios()` and is associated with one or multiple active rules an active attribute declared in `scenarios()` and is associated with one or multiple active rules
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment