I need to perform several post-validations in a Symfony form. First time I came across this issue I wrote this:
$this->validatorSchema->setPostValidator(
new sfValidatorCallback(array(
'callback' => array($this, 'checkStatusHasMethod'))
));
since I only wanted to check a certain situation.
But as the application has grown, I need now to perform additional checks. I would like to keep every validation isolated in different methods, instead of having a big checkX method where everything is kept together.
Is it possible to associate a sfPostValidator with more than one method or create several sfPostValidator instances in validatorSchema?
Thanks!
Try mergePostValidator() (or similar, can’t remember the exact method name)