When you have multiple rules for a single attribute like the code below, when you set 'cancelOnFail' for an attribute for instance for the email, it will stop the whole validation chain if PresenceOf for email fails, What i need is to be able to stop the validation only for email attribute and continue the validation for the rest of attributes, how to achive that?
$validation->add(
'email',
new PresenceOf(
array(
'message' => 'The e-mail is required',
'cancelOnFail' => true
)
)
);
$validation->add(
'email',
new Email(
array(
'message' => 'The e-mail is not valid'
)
)
);
$validation->add(
'name',
new PresenceOf(
array(
'message' => 'The name is required'
)
)
);