Issue Type: Improvement Created: 2009-03-19T11:44:42.000+0000 Last Updated: 2009-06-13T02:15:42.000+0000 Status: Resolved Fix version(s): - 1.8.4 (23/Jun/09)
Reporter: Bert Van Hauwaert (becoded) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Form
Related issues: Attachments:
For the moment, it is impossible to specify elementDecorators together with some exceptions configured for an element in an config file.
For example, I want an ul - li structure. Displaying the label, the element, errors and description. I set the decorators for the form and for the elements (elementDecorator). I don't want to display the label for the submit button. So I add a custom config for the button.
Now, you could think that the elementDecorators would be used for every element except for the elements where you specified a custom decorator set. Just like the order in css: inline style overrules internal style sheets, internal style sheets overrules external stylesheets and external stylesheets overrules the browser default.
This doesn't work. The decorators defined for a single element are ignored.
The problem is that the elements are set and afterwards, the method setElementDecorators is called in the setOptions method of Zend_Form. The function setElementDecorators supports to set only the decorators for a given list of elements but this feature isn't used in the setOptions method. I suggest to look if the elements are set in the given option set. If this is the case and elementDecorators are set too, then lookup all the elements that don't specify custom decorators and use those elements to be used as an argument for the setElementDecorators.
<pre class="highlight"> <?xml version="1.0"?> textFoo textBar submitViewHelperHtmlTagliFormElementsHtmlTagul Form ViewHelperErrorsDescriptionpdescription Label HtmlTagli
Posted by Matthew Weier O'Phinney (matthew) on 2009-06-13T02:15:40.000+0000
Fixed in trunk and 1.8 release branch. Thanks for stopping by at DPC to say hello, Bert!
Have you found an issue?
See the Overview section for more details.