Hi,

when I set element decorators with the setDecorators() method using an
array I get a different output than doing the same with a
Zend_Config_Xml object.

----------------------------------------------------------------------
Using:

$name->setDecorators(array(
        'ViewHelper',
        'Errors',
        array(array('data' => 'HtmlTag'),
              array('tag' => 'div', 'class' => 'element')),
        array('Label', array('class' => 'left')),
        array(array('row' => 'HtmlTag'),
              array('tag' => 'div', 'class' => 'row')),
    ));

produces output:

<div class="row">
<label for="name" class="left required">Name</label>
<div class="element">
<input type="text" name="name" id="name" value="" size="40">
</div>
</div>

----------------------------------------------------------------------
Using an xml file:

<name>
        <type>text</type>
        <options>
                <size>40</size>
                <maxlength>40</maxlength>
                <label>Name</label>
                <decorators>
                        <viewhelper>
                                <decorator>ViewHelper</decorator>
                        </viewhelper>
                        <errors>
                                <decorator>Errors</decorator>
                        </errors>
                        <data>
                                <decorator>HtmlTag</decorator>
                                <options>
                                        <tag>div</tag>
                                        <class>element</class>
                                </options>
                        </data>
                        <label>
                                <decorator>Label</decorator>
                                <options>
                                        <class>left</class>
                                </options>
                        </label>
                        <row>
                                <decorator>HtmlTag</decorator>
                                <options>
                                        <tag>div</tag>
                                        <class>row</class>
                                </options>
                        </row>
                </decorators>
        </options>
</name>

produces output:

<label for="name" class="left required">Name</label>
<div class="row">
<input type="text" name="name" id="name" value="" size="40">
</div>

----------------------------------------------------------------------

It seems as if the declaration of the "row" decorator overwrites the
declaration of the "data" decorator.

How do I need to declare the decorators in the xml file to get the same
result as above?

Thanks and best regards,

Ralf

Reply via email to