Zend_Form getErrors

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

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

Therefore, internal arrays are empty. What do I need to do to find out why the form is invalid? The code is not developed by me, but there is nothing suspicious about it.

+4
source share
1 answer

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

  $form->isValid($this->_getAllParams()); $form_messages = $form->getMessages(); 
+7
source

Source: https://habr.com/ru/post/1437000/


All Articles