Is it possible to alter an html attribute of a Zend_Form_Element in a Decorator previously added ?
Lets say I have a decorator named RichTextArea. When I add it to a Zend_Form_Element_Textarea, I want the decorator to add the class “rich” to the textarea.
The final output should look like this :
<textarea name="content" id="content" class="rich" />
It is possible, but the syntax depends a little on how you are building the form. Easiest way is to do it on the element itself as you add it:
or if you mass-assigned the decorators, e.g.:
If you are using a rich text editor like TinyMCE or similar, another option might be to create a custom form element that extends Zend_Form_Element_Textarea and always add your class to it.