Revision #4 has been created by Orteko on Apr 18, 2011, 6:10:20 AM with the memo:
fix typos
« previous (#3) next (#5) »
Changes
Title
unchanged
Create your own Validation Rule
Category
unchanged
How-tos
Yii version
unchanged
Tags
unchanged
validator, validation rules, model validation, create validator
Content
changed
[...]
```php
/**
* check if the user password is strong enough
* check the password against the pattern requested
* by the strenght
h parameter
* This is the 'passwordStrength' validator as declared in rules().
*/[...]
In our rules method we used this rule on the password attribute, so the value of attribute inside our validation model will be **password**
In the rule we also setted an additional parameter named **strenght
h**
the value of that parameter will be inside the $params array
As you can see inside the method we are making a call to [CModel::addError()](http://www.yiiframework.com/doc/api/1.1/CModel#addError-detail).
Add Error accepts two parameters: the first one is the name of the attribute that you want to display the error in your form, the second one is the actual error string you want to be displayed.[...]