I have created a form with zend form.
I process the data in one action and then redirect to the another action.
So in case of an error I redirect to the last form, if there was no error I redirect the user to another url.
So when isValid() fails I use the getMessages() (the getErrorMessages doesn’t return anything) to get the messages, serialize it, place it in a session property and then redirect to the form page. My problem is now setting those error msg’s in the form to let the user know there was a problem.
I have tried this
$form->setErrors(unserialize($this->_session->form_error_msgs));
But this doesn’t do anything. What do I have to do to display the error msgs next to the fields??
you should add the error to the field, for example
your code might not be working because you haven´t configured the form decorators…