I've declared my validation fields of my view in this way:
public $validate = array(
'myField' => array(
'alphaNumeric' => array(
'rule' => 'alphaNumeric',
'required' => true,
'message' => 'username required'
),
'unique' => array(
'rule' => 'isUnique',
'required' => 'create',
'message' => 'Username already used'
)
)
);
Is there a way to know (inside the relative controller class) when this message is fired? Because if one of these rules is violated, I would like to perform some tasks, and not simply show message to the user.