Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend_Form getErrors

I have a form.
It's checked: $isValid = $form->isValid($this->getRequest()->getPost())

The problem is errors are empty.
$form->getErrors() returns array {"field1": [], "field2": [], "field3": [], "field4": []} when form is invalid.

So inner arrays are empty. What should I do to find why form is invalid? Code is not developed by me, but there is nothing suspicious in it.

like image 672
Dmitry Avatar asked Sep 30 '12 02:09

Dmitry


1 Answers

You could use $form->getMessages() to get the error messages.

 $form->isValid($this->_getAllParams());
 $form_messages = $form->getMessages();
like image 60
ro ko Avatar answered Sep 23 '22 20:09

ro ko