I've split up a Form into 3 SubForms and for one of the elements, in the last SubForm, I am creating a Validator that extends Zend_Validator_Abstract
.
This validator needs to check that a value, on the second SubForm, is not empty. However this value will not be in the $context
array for the element in the Third SubForm.
What is a sensible way of making this value available in the $context
across SubForms?
...
After some thought, the only way I can think of doing this is to pass a reference of the parent Form to the Validator's constructor despite it breaking encapsulation.