-- Ralf Eggert <[EMAIL PROTECTED]> wrote
(on Thursday, 08 May 2008, 12:08 PM +0200):
> the usage of setElementDecorators() only effects all elements that have
> been added to the form before. If I want to use other decorators than
> these "defaults" for an element, I can simple add it after the usage of
> setElementDecorators() and set the individual decorators.
> 
> Now this does not work when I use an Zend_Config_Xml object. I cannot
> declare some <elements>, then set the <elementDecorators> values and
> afterwards declare other <elements> in the XML file. 

Correct; elementDecorators is intercepted in setOptions(), and executed
late. The assumption is that if elementDecorators is in your
configuration, you want the setting to apply to all elements.

Additionally, I'm suspecting Zend_Config_Xml is going to collapse the
multiple 'elements' sections in your config file to a single array.

> If I try it, I get an fatal error:
> 
>   Fatal error: Call to a member function getOrder() on a non-object in
>   /home/devhost/phpmagazin/form/library/Zend/Form.php on line 824

Hmmm... Can you send some reproduce code for this?

> When I use the <elementDecorators> Options before or after the
> <elements> Options then the <elementDecorators> are used for each
> element and the individual settings of <decorators> within the <options>
> of an element are ignored.

Correct -- see above explanation.

> The only solution is to declare all decorators for each element
> separately and resign from the usage of <elementDecorators> with an XML
> file.
> 
> Is it possible to amend Zend_Form to pass an array of elements to
> setElementDecorators() so that individual decorator settings for an
> element are not overwritten by setElementDecorators()?

This is an interesting idea. Could you put a request in the issue
tracker for this? It would be fairly trivial to implement, and would
solve a number of the issues people have reported regarding the usage of
setElementDecorators().

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to