Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
- }
- class ExampleForm extends Core_Form
- {
- public function init()
- {
- // Example Field
- $example = new Zend_Form_Element_Hidden('example');
- $this->addElement($example);
- }
- }
- <?php echo $this->exampleForm->example; ?>
- <li><input type="hidden" name="example" value=""></li>
- class ExampleForm extends Core_Form
- {
- public function init()
- {
- //Example Field
- $example = new Zend_Form_Element_Hidden('example');
- $this->addElement($example);
- }
- public function loadDefaultDecorators()
- {
- $this->example->setDecorators(array('ViewHelper'));
- }
- }
- <?php echo $this->exampleForm->example->setDecorators(array('ViewHelper')) ; ?>
- class M_Form_Element_Hidden extends Zend_Form_Element_Hidden {
- public function init() {
- $this->setDisableLoadDefaultDecorators(true);
- $this->addDecorator('ViewHelper');
- $this->removeDecorator('DtDdWrapper');
- $this->removeDecorator('HtmlTag');
- $this->removeDecorator('Label');
- return parent::init();
- }
- }
- $element = new M_Form_Element_Hidden('myElement');
- $this->addElement($element);
- $this->addElement(
- 'text',
- 'a1',
- array('required' => true, 'validators' => array('Alpha'))
- );
- $this->setElementDecorators(array('ViewHelper'));
- $nombre1 = new Zend_Form_Element_Text(
- 'n1',
- array('id'=> 'Nombre1', 'validators' => array('Alpha') )
- );
- //$nombre1->setDecorators(array('ViewHelper'));
- $this->addElement($nombre1);
- //$nombre1->setDecorators(array('ViewHelper'));
Add Comment
Please, Sign In to add comment