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
| class Form_UserForm extends Zend_Form {
public function init() {
$this->setMethod('post');
$id = $this->createElement('hidden', 'id');
$id->setDecorators(array('ViewHelper'));
$this->addElement($id);
$username = $this->createElement('text','username');
$username->setLabel(' Utilisateur : ');
$username->setRequired('true');
$username->addFilter('StripTags');
$username->addErrorMessage('Champ obligatoire !');
$this->addElement($username);
$password = $this->createElement('password', 'password');
$password->setLabel('MdP : ');
$password->setRequired('true');
$this->addElement($password);
$this->addElement('submit', 'submit_btn', array('label' => 'OK'));
$this->addElement('button', 'button_btn', array('label' => 'Retour'));
$this->addDisplayGroup( array('id', 'submit_btn','button_btn') ,'buttons');
$this->setElementDecorators( array('ViewHelper',
new Zend_Form_Decorator_HtmlTag(array('tag' => 'span')) ),
array('submit_btn', 'button_btn', 'buttons'));
}
} |
Partager