0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
LoginForm.php
Go to the documentation of this file.
1 <?
24 class LoginForm extends Zend_Form
25 {
26  public function init() {
27  $username = $this->addElement('text', 'username', array(
28  'filters' => array('StringTrim', 'StringToLower'),
29  'validators' => array(
30  'Alnum',
31  array('StringLength', false, array(3, 20)),
32  ),
33  'required' => true,
34  'label' => 'Your username:',
35  ));
36 
37  $password = $this->addElement('password', 'password', array(
38  'filters' => array('StringTrim'),
39  'validators' => array(
40  'Alnum',
41  array('StringLength', false, array(3, 20)),
42  ),
43  'label' => 'Password:',
44  ));
45 
46  $login = $this->addElement('submit', 'login', array(
47  'required' => false,
48  'ignore' => true,
49  'label' => 'Login',
50  ));
51 
52  // We want to display a 'failed authentication' message if necessary;
53  // we'll do that with the form 'description', so we need to add that
54  // decorator.
55  $this->setDecorators(array(
56  'FormElements',
57  array('HtmlTag', array('tag' => 'dl', 'class' => 'zend_form')),
58  array('Description', array('placement' => 'prepend')),
59  'Form'
60  ));
61  }
62 }
63 
64 ?>
65 
Copyright (C) 2007-2015 Hypertable, Inc.
Definition: LoginForm.php:24