I class User
array('username, email, password', 'required'),
'value'=>new CDbExpression(':password', array(':password'=>$this->hashPassword(':password') ) ),
it doesn’t work!
can anyone help me?
I wonder if rules allow such a use.
In any case, you can use beforeSave in your model to hash the password. There are many examples here and there.
bennouna is right, you can’t use the rules for that. Take a look at this wiki entry. Simple and useful: http://www.yiiframework.com/wiki/240/authenticating-against-phpass-hashes-with-yii