1 2 3 4 5 6 7 8 9 10 11
|
$decoratorElem = array ('ViewHelper', 'Description', array ('HtmlTag', array ('tag' => 'td' ) ), array ('Label', array ('requiredSuffix' => ' *', 'tag' => 'td', 'align' => 'left', 'valign' => 'top', 'width' => '110px' ) ), array (array ('tr' => 'HtmlTag' ), array ('tag' => 'tr' ) ) ); // définition du décorateur pour l'alignement du champ et de son label
$nom = new Zend_Form_Element_Text ('nom');
$nom->setName('nom');
$nom->setLabel('Nom'); // label de l'élément
$nom->setOrder(1);
$nom->setRequired(true); // champ obligatoire
$nom->setDecorators($decoratorElem); // affectation du décorateur à l'élément
$elementGrossier->addElement($nom); // ajout de l'élément au formulaire |
Partager