I read this question on SO: "how to disable inArray validator forms in zend framework2" and was trying to find it out, but couldn't find any way to detach/remove the InArray
Validator. But InArray
is just a validator. So how can remove a validator from the validator list of a form element?
I can get the validators:
$myElement = $form->getInputFilter()->get('city');
$validatorChain = $cityElement->getValidatorChain();
$validators = $validatorChain->getValidators();
and maybe can then unset the array element with the validator, I want to remove, and then pass the result array back to the Input object and to the form element. But it's really dirty and surely not the recommended way.
So how to remove a validator from a form element?