Consider a form MyForm, containing a fieldset MyFieldset, containing a field MyField.
I’m writing a custom validator for MyField and I need to access the value of another field in the form which is not in the same fieldset.
In the isValid method of the validator I have access to the $context object, which seems to contain the values of the other fields in the same fieldset.
Is there a way to access the values of other fields of the form, not in the same fieldset?
I’m using zendframework/zendframework version 2.4.12
One way is to add additional field on higher level of form (where fieldset is added) and attach validator there. Context always get raw data from nested fields, but not from parents.