Reference: Model rules validation

Comparing #27 with #28

Revision #28 was created by acy acy on Jul 2, 2013, 8:47:59 PM.

fixed code

Content

[...]
array('username, password', 'required'), // built-in alias for CRequiredValidator
array('username', 'ext.MyValidators.MyLoginValidator'), // Custom validation class
);
}

public
function validateLogin() { // [...]
 
}
 
```

### Scenarios

Each model object has a scenario property.
Some scenarios are built-in and will be assigned automatically by Yii, but you can define your own.
[...]