How to change the tag of the default Errors decorator within Zend_Form?

852 Views Asked by At

I'm trying to change the tag of the Errors decorator, currently it's:

<ul class="errors">
  <li>error message</li>
</ul>

I'd like to remove the <ul> wrapper and change the <li> by ie <p>.

I tried a lot of things, but can't get it to work..

Any ideas?

1

There are 1 best solutions below

0
On

You can't change the default tags of the Errors decorators because it calls the default views helper Zend_View_Helper_FormErrors and you've no way to pass paramaters.

So you'll to write your own Decorator & View Helper.

I did something similar to wrap errors into <label> elements

I created LabelledErrors decorator which calls a FormLabelledErrors helper and reset the default decorators, replacing the Errors decorator by my own.