Difference between #1 and #2 of Reference: Model rules validation

Reference: Model rules validation
This is a reference to be used for Model rule validation
andvalidation. The documentation is compiled from the Yii
documentation and code. The purpose is to have all the information gathered in
one place instead of scattered. This reference is not an intro.

Applys to Yii: 1.0.10

## How validation works
The [CModel](/doc/api/1.0.10/CModel) class uses a method named
[rules](/doc/api/1.0.10/CModel#rules-detail) to return an array with the rules
for validation.

public function rules()
    return array(
        array('username, password', 'required'),
        array('password_repeat', 'required', 'on'=>'register'),
        array('password', 'compare', 'on'=>'register'),

The code above is an example of what the [rules()](/doc/api/CModel#rules-detail)
function may look like. The arrays in the main array each one sets a rule of

### Choise of validators

Yii will look for validators in the specifik order:

1. A method in the model class with the same name as the validator specified.
2. A builtin validator in Yii that extends the CValidator class.
3. A path/alias to a home made  CValidator class that is not built in.

### Scenarios

TODO: Write shortly about scenarios.

### Standard parameters

	'attribute list', 
	'validator name', 
	'on'=>'scenario name', 
	'message'=>'The attribute didn\'t validate!', 
	...validation parameters...

+ <code>attribute list</code>: specifies the attributes (separated
by commas) toTo be validated;
+ <code>validator name</code>: specifies the validator to be used.
+ <code>on</code>: this specifies the scenarios when the validation
rule should be performed. Separate different scenarios with commas. If this
option is not set, the rule will be applied in any scenario.
+ <code>message</code>: Error message if validation fails.
+ <code>...validation parameters...</code>: any number of extra
parameters to be used by the specified validator.continued

## Validation rules reference

+ <code>boolean</code> :
+ <code>captcha</code> :
+ <code>compare</code> :
+ <code>default</code> :
+ <code>email</code> : [CEmailValidator](/doc/api/CEmailValidator)
+ <code>exists</code> : [CExistValidator](/doc/api/CExistValidator)
+ <code>file</code> : [CFileValidator](/doc/api/CFileValidator)
+ <code>filter</code> :
+ <code>in</code> : [CRangeValidator](/doc/api/CRangeValidator)
+ <code>length</code> :
+ <code>numerical</code> :
+ <code>match</code> :
+ <code>required</code> :
[CRequiredValidator](/doc/api/CRequiredValidator), validates that the specified
attribute does not have null or empty value.
+ <code>safe</code> : [CSafeValidator](/doc/api/CSafeValidator)
+ <code>type</code> : [CTypeValidator](/doc/api/CTypeValidator)
+ <code>unique</code> :
+ <code>unsafe</code> :
+ <code>url</code> :
[CUrlValidator](/doc/api/CUrlValidator)TODO: Write all

## Selected readings
[The Definitive Guide to Yii: Working with Forms - Creating
Model](/doc/guide/form.model)<br />
[CModel::validate()](/doc/api/CModel#validate-detail)<br />
[CModel::rules()](/doc/api/CModel#rules-detail)<br />
[CModel::$scenario](/doc/api/CModel#scenario-detail)<br />
[CValidator](/doc/api/CValidator)<br />
[Yii PHP Framework Class Reference -
### Built in validators in Yii
[CBooleanValidator](/doc/api/CBooleanValidator)<br />
[CCaptchaValidator](/doc/api/CCaptchaValidator)<br />
[CCompareValidator](/doc/api/CCompareValidator)<br />
[CDefaultValueValidator](/doc/api/CDefaultValueValidator)<br />
[CEmailValidator](/doc/api/CEmailValidator)<br />
[CExistValidator](/doc/api/CExistValidator)<br />
[CFileValidator](/doc/api/CFileValidator)<br />
[CFilterValidator](/doc/api/CFilterValidator)<br />
[CInlineValidator](/doc/api/CInlineValidator)<br />
[CNumberValidator](/doc/api/CNumberValidator)<br />
[CRangeValidator](/doc/api/CRangeValidator)<br />
[CRegularExpressionValidator](/doc/api/CRegularExpressionValidator)<br />
[CRequiredValidator](/doc/api/CRequiredValidator)<br />
[CSafeValidator](/doc/api/CSafeValidator)<br />
[CStringValidator](/doc/api/CStringValidator)<br />
[CTypeValidator](/doc/api/CTypeValidator)<br />
[CUniqueValidator](/doc/api/CUniqueValidator)<br />
[CUnsafeValidator](/doc/api/CUnsafeValidator)<br />