Maicon
Maicon

Reputation: 21

Decorators ul li zend_form

<form enctype="application/x-www-form-urlencoded" action="" method="post">
<ul>
<div>
<fieldset id="fieldset-groups"><legend>Endereço</legend>

    <li>
        <label for="name" class="optional">Name</label>
        <input type="text" name="name" id="name" value="">
            <div class="errors">
                    <p>Error</p>
            </div>
    </li>

</fieldset>   

</div>
</ul>
</form>

How do I make my way the code above, using the decorator zend?

Upvotes: 2

Views: 1441

Answers (1)

Maicon
Maicon

Reputation: 33

I tried this way:

    $this->addDecorator('FormElements')
         ->addDecorator('HtmlTag', array('tag' => 'ul'))
         ->addDecorator('Form');
    $this->setElementDecorators( array(
                                    'ViewHelper',
                                    'Label',
                                    'Errors',
                                    new Zend_Form_Decorator_HtmlTag(array('tag' => 'li')) 
                                ));
    $this->setDisplayGroupDecorators( array(
                                        'FormElements',
                                        'Fieldset',
                                        'FormErrors',
                                         new Zend_Form_Decorator_HtmlTag(array('tag' => 'li')),
                                      ));  

The problem is that I need to float the label and text elements, so I tried to use a list.

This was the only way I could.

Upvotes: 0

Related Questions