Created
December 9, 2012 22:37
-
-
Save scan/4247319 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Application_Form_NewUser extends Twitter_Bootstrap_Form_Horizontal | |
{ | |
public function init() | |
{ | |
$this->setMethod('post'); | |
$this->setName('newUserForm'); | |
$this->addElement('text', 'email', array( | |
'label' => 'e-Mail', | |
'required' => true, | |
'filters' => array('StringTrim', 'StringToLower'), | |
'validators' => array('EmailAddress'), | |
'attribs' => array('required' => 'required'), | |
)); | |
$this->addElement('password', 'password', array( | |
'label' => 'Passwort', | |
'required' => true, | |
'attribs' => array('required' => 'required'), | |
)); | |
$this->addElement('password', 'password_confirm', array( | |
'label' => 'Passwort wiederholen', | |
'required' => true, | |
'attribs' => array('required' => 'required'), | |
)); | |
$this->addElement('text', 'address', array( | |
'label' => 'Adresse', | |
'required' => true, | |
'attribs' => array('required' => 'required'), | |
)); | |
$this->addElement('text', 'zip', array( | |
'label' => 'PLZ', | |
'maxlength' => 5, | |
'required' => true, | |
'attribs' => array('required' => 'required'), | |
)); | |
$this->addElement('text', 'city', array( | |
'label' => 'Ort', | |
'required' => true, | |
'attribs' => array('required' => 'required'), | |
)); | |
$this->addElement('text', 'country', array( | |
'label' => 'Land', | |
'value' => 'Deutschland', | |
'required' => true, | |
'attribs' => array('required' => 'required'), | |
)); | |
$this->addDisplayGroup( | |
array('email', 'password', 'password_confirm'), | |
'login', | |
array('legend' => 'Logindaten', 'order' => 1) | |
); | |
$this->addDisplayGroup( | |
array('address', 'zip', 'city', 'country'), | |
'address', | |
array('legend' => 'Adressdaten', 'order' => 2) | |
); | |
$this->addElement('button', 'submit', array( | |
'label' => 'Speichern', | |
'type' => 'submit', | |
'buttonType' => 'primary', | |
'icon' => 'ok', | |
'escape' => false, | |
)); | |
$this->addDisplayGroup( | |
array('submit'), | |
'actions', | |
array( | |
'disableLoadDefaultDecorators' => true, | |
'decorators' => array('Actions'), | |
'order' => 5, | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment