If we add the element decorators from the form, then we override the current decorators of the element. Bad idea!

Posted by Sam Adams (samadams83) on 2012-08-25T16:13:35.000+0000

I agree that explicitly set decorators should take precedence over the form element defaults, but it makes sense to be able to change the default set of decorators that are used for elements without explicitly set decorators. The alternative is (if you want to use the object method) to add the decorators to each element every time, which is wasteful.
Is there a way of inspecting the element object to see if decorators were set, and if not, set the form default?

Posted by shamseer (shamseerss) on 2012-09-05T12:51:23.000+0000

when an element is created by this code
$el = new Zend_Form_Element_Text('foo');

default decorators(ViewHelper, Errors,....) added by default, if decorator option is not specified in the constructor.

Better to create your own factory for elements creation

Posted by Frank Brückner (frosch) on 2012-09-05T13:00:51.000+0000

@[~samadams83]
{quote}Is there a way of inspecting the element object to see if decorators were set, and if not, set the form default?{quote}
Yes. I will look into it.