Why don't error messages appear in zend_form if validation fails?

I am trying to get standard error messages in zend_form, but they do not.

I have it:

if ($form->isValid($formData)) {
                // do stuff
            } else {
                $form->populate($formData);
                $this->view->form = $form;
            }

When I submit an invalid form, the form is displayed in the view as intended, but from the tutorials it seems that error messages should appear by default?

What am I missing?

Thank you for your help!

+3
source share
1 answer

Error messages are applied using the Decorator pattern. By default, there are some default Zend form element decorators.

I think you overwrite the default decorators, using, for example setDecorators().

+2

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


All Articles