I set post validator in embedded form:
class myEmbeddedForm extends BaseForm {
function configure() {
...
$this->validatorSchema->setPostValidator(new sfValidatorCallback(array(
'callback' => array($this, 'embeddedPostValidator')
)));
}
function embeddedPostValidator($validator, $values) {
...
}
}
And form which include this embedded form has to cancel this post validator in embedded form's pre validator?
function myForm extends BaseForm {
function configure() {
...
$this->embedForm('embedded', new myEmbeddedForm(array(), array(
...
)));
...
$this->validatorSchema->setPreValidator(new sfValidatorCallback(array(
'callback' => array($this, 'myPreValidator')
)));
}
function myPreValidator($validator, $values) {
...
// how to cancel post validator in embedded form here?
}
}
Pleas help me!
Sorry for my bad english.