Well, in 2012 and the same question. If you remove the decorators, html will not be checked. If you leave them, hidden elements take up space. In all my projects, I have a CSS.hidden helper, so I just apply it to <dd> and remove the label:
$element = new Zend_Form_Element_Hidden('foo', array('value' => 'bar')); $element->removeDecorator('Label'); $element->getDecorator('HtmlTag')->setOption('class', 'hidden');
Virtual html (5), beautiful looking forms. It may also be part of a custom decorator for hidden fields.
EDIT
This is how I put it in my own form element:
class Exanto_Form_Element_Hidden extends Zend_Form_Element_Hidden { public function render(Zend_View_Interface $view = null) { $this->removeDecorator('Label'); $this->getDecorator('HtmlTag')->setOption('class', 'hidden'); return parent::render($view); } }
Novalis Jul 31 '12 at 17:32 2012-07-31 17:32
source share