Let\'s say I have a product which can have a colour. Depending on the product type, the colour field may or may not be required.
If colour is always required, I would ha
class LoginForm extends CFormModel { public $username; public $password; } $form = new LoginForm(); $form->validatorList->add( CValidator::createValidator('required', $form, 'username, password') );
Now $form has two required fields.