<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 ma开发者_运维知识库ke my way the code above, using the decorator zend?
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.
精彩评论