Created
February 17, 2012 09:46
-
-
Save alexander-torosh/1852238 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_Users extends Zend_Form | |
| { | |
| public function init() | |
| { | |
| $this->setName('users'); | |
| $id = new Zend_Form_Element_Hidden('id'); | |
| $id->addFilter('Int'); | |
| $login = new Zend_Form_Element_Text('login'); | |
| $login->setLabel('Логин') | |
| ->setRequired(true) | |
| ->addFilter('StripTags') | |
| ->addFilter('StringTrim') | |
| ->addValidator('NotEmpty'); | |
| $password = new Zend_Form_Element_Text('password'); | |
| $password->setLabel('Пароль') | |
| ->setRequired(true) | |
| ->addFilter('StripTags') | |
| ->addFilter('StringTrim') | |
| ->addValidator('NotEmpty'); | |
| $organization_id = new Zend_Form_Element_Text('organization_id'); | |
| $organization_id->setLabel('Организация') | |
| ->setRequired(true) | |
| ->addFilter('StripTags') | |
| ->addFilter('StringTrim') | |
| ->addValidator('NotEmpty'); | |
| // ->addMultiOptions($_sectionModel->fetchPairsSelectBox()); | |
| $employee_id = new Zend_Form_Element_Text('employee_id'); | |
| $employee_id->setLabel('Должность') | |
| ->setRequired(true) | |
| ->addFilter('StripTags') | |
| ->addFilter('StringTrim') | |
| ->addValidator('NotEmpty'); | |
| //->addMultiOptions($_sectionModel->fetchPairsSelectBox()); | |
| $role = new Zend_Form_Element_Text('role'); | |
| $role->setLabel('Роль') | |
| ->setRequired(true) | |
| ->addFilter('StripTags') | |
| ->addFilter('StringTrim') | |
| ->addValidator('NotEmpty'); | |
| // ->addMultiOptions($_sectionModel->fetchPairsSelectBox()); | |
| $submit = new Zend_Form_Element_Submit('submit'); | |
| $submit->setAttrib('login', 'submitbutton'); | |
| $this->addElements(array($login, $password, $organization_id, $employee_id, $role, $submit)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment