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
|
$form = new Zend_Form();
$form->setDecorators(array(
'FormElements',
array('HtmlTag', array('tag' => 'table')),
'Form',
));
$foo = new Zend_Form_Element_Text("foo");
$foo->setLabel("foo");
// Cette ligne est censée rendre la même chose ...../.....
$foo->addDecorator('HtmlTag', array('tag' => 'td'))
->addDecorator('Label', array('tag' => 'th'))
->addDecorator('ViewHelper', array('tag' => 'td'));
// .../... Que celle-ci
$foo->setDecorators(array(
array('ViewHelper', array('tag' => 'td')),
'Errors',
array('Label', array('tag' => 'th')),
array('HtmlTag', array('tag' => 'td'))
));
$form->addElement($foo);
$form->addDisplayGroup(array("foo", "group_foo");
$group = $form->getDisplayGroup("group_foo");
$group->setDecorators(array(
'FormElements',
array('HtmlTag',array('tag'=>'tr'))
));
// Ensuite dans la vue:
<?php echo $this->form; ?> |
Partager