1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
$form = new Zend_Form();
$form->setDecorators(array(
'FormElements',
array('HtmlTag', array('tag' => 'table')),
'Form',
));
$foo = new Zend_Form_Element_Text("foo");
$foo->setLabel("foo");
$foo->addDecorators(array(
array('ViewHelper', array('tag' => 'td')),
array('Label', array('tag' => 'th')),
array('HtmlTag', array('tag' => 'td'))
));
$form->addElement($foo);
$bar = new Zend_Form_Element_Text("bar");
$bar->setLabel("bar");
$bar->setDecorators(array(
array('ViewHelper', array('tag' => 'td')),
'Errors',
array('Description', array('tag' => 'p')),
array('Label', array('tag' => 'th')),
array('HtmlTag', array('tag' => 'td'))
));
$form->addElement($bar);
$form->addDisplayGroup(array("foo","bar"), "group");
$group = $form->getDisplayGroup("group");
$group->setDecorators(array(
'FormElements',
array('HtmlTag',array('tag'=>'tr'))
));
$this->view->form = $form; |
Partager