if you want to use your own validator class, I think that what you should do is:
create your own Validator class that inherits from CValidator. Create it in folder yourApp/protected/validators for instance.
class MyValidator extends CValidator {
/**
* Validates the attribute of the object.
* If there is any error, the error message is added to the object.
* @param CModel the object being validated
* @param string the attribute being validated
*/
protected function validateAttribute($object,$attribute){
$this->addError($object,$attribute,"my validator error");
}
}
2.in the Model, use this validator
public function rules()
{
return array(
array('password', 'application.validators.MyValidator')
);
}
And that's it. I think you're not supposed to modify Yii core classes (like CValidator).
Additional note: You should never change anything in your framework folder! This is not necessary as you can put your own classes somewhere in your application folder (or maybe some other shared place). Doing so will save you a lot of headache when upgrading to another version of Yii later.