Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.24 KB | None | 0 0
  1. <?php
  2. class loginForm extends Zend_Form
  3. {
  4. protected $config; 
  5.  
  6.     public function __construct($options = null)
  7.     {
  8.         //$registry = Zend_Registry::getInstance();
  9.         parent::__construct($options);
  10.         $this->setName('loginForm');
  11.         $this->setMethod(self::METHOD_POST);
  12.         // nějaká změna
  13.         $notempty = new Zend_Validate_NotEmpty();
  14.         $DBaccount = new Zend_Validate_Db_RecordExists('forum.mybb_users', 'username');
  15.  
  16.        
  17.         $username = new Zend_Form_Element_Text('username');
  18.         $username->setRequired(true)
  19.         ->SetLabel('Jméno: ')
  20.         ->addFilter('StripTags')
  21.         ->addFilter('StringTrim')
  22.         ->addValidator($notempty)
  23.         ->addValidator($DBaccount);
  24.        
  25.         $pass = new Zend_Form_Element_Password('password');
  26.         $pass->setRequired(true)
  27.         ->SetLabel('Heslo: ')
  28.         ->addFilter('StripTags')
  29.         ->addFilter('StringTrim')
  30.         ->addValidator($notempty);
  31.        
  32.         $token = new Zend_Form_Element_Hash('token');
  33.  
  34.        
  35.         $submit = new Zend_Form_Element_Submit('submit');
  36.         $submit->SetLabel('Přihlásit se');
  37.         $submit->setAttrib('id', 'submitbutton');
  38.        
  39.        
  40.         $this->addElements(array( $username,$pass,$token, $submit));
  41.        
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement