I have a class that extends Zend_Form like this (simplified):
class Core_Form extends Zend_Form { protected static $_elementDecorators = array( 'ViewHelper', 'Errors', array('Label'), array('HtmlTag', array('tag' => 'li')), ); public function loadDefaultDecorators() { $this->setElementDecorators(self::$_elementDecorators); } }
Then I use this class to create all my forms:
class ExampleForm extends Core_Form { public function init() {
In one of my views, I only need to display this one field (without anything else created by Zend_Form). Therefore, in my opinion, I have the following:
<?php echo $this->exampleForm->example; ?>
This works great, except that it generates a field as follows:
<li><input type="hidden" name="example" value=""></li>
This is obviously because I installed the HtmlTag include element decorators: tag => 'li'.
My question is: how can I turn off all decorators for this element. I don't need decorators for hidden input elements.
php zend-framework zend-form
leek Dec 17 '08 at 10:00 p.m. 2008-12-17 22:00
source share