Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Registrace uživatele
- * @todo Potřeba dodělat validaci políček, případně doplnit další věci.
- */
- class Application_Form_User extends Zend_Form
- {
- public function init()
- {
- $this->addElements(array(
- $nickname = new Zend_Form_Element_Text('nickname'),
- $password = new Zend_Form_Element_Password('password'),
- $repassword = new Zend_Form_Element_Password('repassword'),
- $phone = new Zend_Form_Element_Text('phone'),
- $email = new Zend_Form_Element_Text('email'),
- $ico = new Zend_Form_Element_Text('ico'),
- $dic = new Zend_Form_Element_Text('dic'),
- $company = new Zend_Form_Element_Text('company'),
- $submit = new Zend_Form_Element_Submit('submit')
- ));
- $nickname->setLabel('Uživatelské jméno')
- ->addValidator('Db_NoRecordExists', true, array(
- 'table' => 'users',
- 'field' => 'nickname',
- 'messages' => array(
- 'recordFound' => 'Toto uživatelské jméno již existuje.'
- )
- ))
- //->setIsArray()
- ->setRequired();
- $password->setLabel('Vaše heslo')
- ->setRequired();
- $repassword->setLabel('Znovu heslo')
- ->addValidator(new Zend_Validate_Identical($_POST['password']))
- ->setRequired();
- $phone->setLabel('Telefon');
- $email->setLabel('Email')
- ->setRequired();
- $company->setLabel('Firma');
- $ico->setLabel('ICO');
- $dic->setLabel('DIC');
- $submit->setLabel('Registrovat');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement