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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
// Construction du sous formulaire
$sousform2 = new Zend_SubForm();
// Décorateur du sous formulaire 2
$decorator2 = array ('FormElements', array ('tag' => 'tr', 'align' => 'center' ), array (array ('table' => 'HtmlTag' ), array ('tag' => 'table', 'width' => '100%', 'border' => '0' ) ), array ('Fieldset', array ('tag' => 'legend', 'class' => 'fieldsetSubForm2' ) ), array (array ('td' => 'HtmlTag' ), array ('tag' => 'td', 'colspan' => 2 ) ), array (array ('tr' => 'HtmlTag' ), array ('tag' => 'tr' ) ) );
// Elément 1
$decoratorElem1 = array ('ViewHelper', array ('Description', array ('tag' => 'span', 'escape' => false' ) ), array (array ('data' => 'HtmlTag' ), array ('tag' => 'td' ) ), array ('Label', array ('tag' => 'td' ) ), array ( array ( 'row' => 'HtmlTag' ), array ( 'tag' => 'tr', 'openOnly' => 'true', 'placement' => 'prepend' ) ) );
$sousformElem1 = new Zend_Form_Element_Text ( 'element_1' );
$sousformElem1->setName ( 'element_1' );
$sousformElem1->setDescription ( 'Element 1' );
$sousformElem1->setLabel ( 'Element 1' );
$sousformElem1->setOrder ( 1 );
$sousformElem1->setDecorators ( $decoratorElem1 );
sousform2->addElement ( $sousformElem1 );
// Elément 2
$decoratorElem2 = array ('ViewHelper', array ('Description', array ('tag' => 'span', 'escape' => false) ) ), array (array ('data' => 'HtmlTag' ), array ('tag' => 'td' ) ), array ('Label', array ('tag' => 'td' ) ) );
$sousformElem2 = new Zend_Form_Element_Text ( 'element_2' );
$sousformElem2->setName ( 'element_2' );
$sousformElem2->setDescription ( 'Elément 2' );
$sousformElem2->setLabel( 'Elément 2' );
$sousformElem2->setOrder ( 2 );
$sousformElem2->setDecorators ( $decoratorElem2 );
sousform2->addElement ( $sousformElem2 );
// Elément 3
$decoratorElem3 = array ('ViewHelper', array ('Description', array ('tag' => 'span', 'escape' => false ) ), array (array ('data' => 'HtmlTag' ), array ('tag' => 'td' ) ), array ('Label', array ('tag' => 'td' ) ) );
$sousformElem3 = new Zend_Form_Element_Text ( 'element_3' );
$sousformElem3->setName ( 'element_3' );
$sousformElem3->setDescription ( 'Elémetn 3' );
$sousformElem3->setLabel( 'Elément 3' );
$sousformElem3->setOrder ( 3 );
$sousformElem3->setDecorators ( $decoratorElem3 );
sousform2->addElement ( $sousformElem3 );
// Elem4
$decoratorElem4 = array ('ViewHelper', array ('Description', array ('tag' => 'span', 'escape' => false) ), array (array ('data' => 'HtmlTag' ), array ('tag' => 'td' ) ), array ('Label', array ('tag' => 'td' ) ), array ( array ( 'row' => 'HtmlTag' ), array ( 'tag' => 'tr', 'closeOnly' => true, 'placement' => 'append' ) ) );
$sousformElem4 = new Zend_Form_Element_Text ( 'element_4' );
$sousformElem4->setName ( 'element_4' );
$sousformElem4->setDescription ( 'Elément 4' );
$sousformElem4->setLabel( 'Elément 4' );
$sousformElem4->setOrder ( 4 );
$sousformElem4->setDecorators ( $decoratorElem4 );
sousform2->addElement ( $sousformElem4 );
$sousform2->setDecorators($decorator2); |
Partager