Chris Laplante
Chris Laplante

Reputation: 29658

Can multiple Zend Form elements share a single Error decorator?

By default, error message decorators render under elements. How can I prepend just one error message decorator to my form that all the elements use to display their errors?

Upvotes: 1

Views: 311

Answers (1)

Tomáš Fejfar
Tomáš Fejfar

Reputation: 11217

AFAIK no, but you can create your own FormError decorator, that would do just that! Assign it to the form and then receive the elements using getElements() and then get errors for each element to display. Actually I think it's a great idea and it inspires me to that for my own form class (now i use view helper for that). But make sure you still display error message near the field for useability reasons.

Upvotes: 2

Related Questions