Symfony : how can i add a post validator without overriding the existing ones?
I'm using sfGuard plugin, and the register form by default has a few post va开发者_StackOverflow中文版lidators (for username and email).
I googled alot and haven't found any methods/hacks for adding post validators without having to rewrite them all...
Because when I do:
$this->validatorSchema->setPostValidator(
new sfValidatorCallback(array('callback' => array($this, 'checkPassword')))
);
all the other post validators seem to disappear.
Try this one:
$this->mergePostValidator(
new sfValidatorCallback(array('callback' => array($this, 'checkPassword')))
);
精彩评论