Posted By

staar2 on 06/16/09


Tagged


Versions (?)

ZF login form


 / Published in: PHP
 

  1. <?php
  2.  
  3. /**
  4. * Form for login
  5. **/
  6. class Form_Login extends Zend_Form {
  7.  
  8.  
  9. public function init() {
  10.  
  11. $this->setName('login');
  12.  
  13. $username = new Zend_Form_Element_Text('username');
  14. $username->setLabel('Username: ')
  15. ->setRequired(true)
  16. ->addFilter('StripTags')
  17. ->addFilter('StringTrim');
  18.  
  19. $password = new Zend_Form_Element_Password('password');
  20. $password->setLabel('Password: ')
  21. ->setRequired(true)
  22. ->addFilter('StripTags')
  23. ->addFilter('StringTrim');
  24.  
  25. $submit = new Zend_Form_Element_Submit('submit');
  26. $submit->setAttrib('id', 'submitbutton');
  27.  
  28. $this->addElements(array($username, $password, $submit));
  29. }
  30. }

Report this snippet  

You need to login to post a comment.