Revision #3 was created by Kabinenkoffer on May 8, 2014, 3:28:17 PM.
editing
Content
RequirementHow-To use a special validation rule
-----------
If you have a form, you sometimes need special validation Rules not included in Yii. Here i share a special rule with you, i just wrote. Maybe you have the case, when a user needs to Fill ou Field A oder the Fields B, C and D.
~~~
```php
public function thisOrThatRequired($attribute, $params) {
if ($params['check']) {
[...]
}
} ~~~```
~~~
```php
public function rules() {
// NOTE: you should only define rules for those attributes that