When adden the "on" paramater to some of my validation rules, the validation doesnt work as it should.
part of the code:
//part of User Model
public function rules(){
return array(
array('email, password', 'required', 'on' => 'login'),
array('password', 'compare', 'compareValue' => 'passwordCheck', 'on' => 'install'),
array('password', 'authenticatePass', 'on' => 'login'),
array('name, email', 'length', 'max' => 128),
array('email', 'email'),
);
}
public function authenticatePass($attribute, $params) {
echo "Start AuthenticatePass";
}
Now when i do the following:
$user = new User();
$user->attributes = $_POST['user'];
$user->validate('login');
$user->validate(‘login’) always returns true. And “Start AuthenticatePass” is echoed nowhere.
Am I missing something? Or is this an error in the 1.1alpha…