Details
Description
I didn't want to add a custom validators and decided to override my form's isValid() instead. Doing my custom logic there was straightforward, except that I couldn't set the errors on my elements as they are managed internally by Zend_Form_Element with no public accessors.
I propose that we add public accessors for errors and messages. It makes sense regardless of the use case I demonstrated.
Currently, you always have to write your own validator, in order to get an error in the stack. I also think it'd be usefull to have a method to push your own custom errors into the error stack on a per element basis:
$myElement->addError('key', 'error message');It would also be convenient to be able to do this on form level, where the input would be an array:
vote +1
$myElement->addError('key', 'error message');