Get all form values within custom zend validate class

A quick one I recently learned about, Zend_Validate_Interface::isValid allows an optional second argument in addition to the required value parameter:

public function isValid($value, $context = null)
{
    Zend_Debug::dump($context);
    die;
}

When used as a form element validator, $context will contain all request data including additional form values. This is useful when your validator depends on values only available in the same request.

comments powered by Disqus