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
| class Application_Form_EditUser extends Zend_Form
{
public function init()
{
$this->setName('/user/edit');
$this->setAction();
$nom = new Application_Form_EText( 'nom', 'Nom : ' );
$nom->addValidator('StringLength', false, array(6, 20));
$prenom = new Application_Form_EText( 'prenom', 'Prenom : ' );
$adresse = new Application_Form_EText( 'adresse', 'Adresse : ' );
$codePostale = new Application_Form_EText( 'codePostale', 'Code Postale : ' );
//$codePostale->addValidator(new Zend_Validate_Regex('#[0-9]{2} ?[0-9]{3}#'));
$ville = new Application_Form_EText( 'ville', 'Ville : ' );
$telMobile = new Application_Form_EText( 'telMobile', 'Numero de telephone mobile : ' );
//$telMobile->setRequired(false)->addValidator('Digits')->addValidator(new Zend_Validate_StringLength(8));
$telFixe = new Application_Form_EText( 'telFixe', 'Numero de telephone fixe : ' );
//$telFixe->setRequired(false)->addValidator('Digits')->addValidator(new Zend_Validate_StringLength(8));
$submit = new Zend_Form_Element_Submit ( 'submit' );
$submit->setAttrib ( 'class', 'submitbutton' )->setLabel ( 'Update' )->setAttrib('class', 'submit');
$elements = array($nom, $prenom, $adresse, $codePostale, $ville, $telMobile, $telFixe, $submit);
$this->addElements( $elements );
}
} |
Partager