I would suggest switching to a full ViewScript form to control the display of form elements.
, , , , :
<?php
class Default_Form_Myform extends Zend_Form
{
public function __construct($options = null) {
parent::__construct($options);
}
public function init() {
parent::init();
$this->setName('myform');
$name = new Zend_Form_Element_Text('name');
$name->setLabel('Name')
->setDescription('Give your name...');
$this->addElement($name);
$submit = new Zend_Form_Element_Submit('submit');
$this->addElement($submit);
$this->clearDecorators();
$this->setElementDecorators(
array(
'viewHelper',
'Errors',
array('Label', array('class' => 'delabel')),
'Description',
array('HtmlTag', array('tag' => 'li')),
)
);
$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'myForm.phtml'))
));
}
}
application/modules/default/views/myForm.phtml
, $this->element->name
<form action="<?= $this->element->getAction(); ?>"
method="<?= $this->element->getMethod(); ?>"
enctype="<?= $this->element->getEnctype(); ?>"
name="<?= $this->element->getName(); ?>">
<ul>
<?= $this->element->name; ?>
<?= $this->element->submit ?>
</ul>
</form>
script -, , <?= $this->form; ?>
. ,
, ...
, .