Skip to content

Instantly share code, notes, and snippets.

@kirkegaard
Created February 1, 2010 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirkegaard/291699 to your computer and use it in GitHub Desktop.
Save kirkegaard/291699 to your computer and use it in GitHub Desktop.
<?php
class Planner_Form_Login extends Zend_Form {
public function init() {
$this->setAction('/auth/process/');
$this->setElementFilters(array('StringTrim', 'StripTags'));
$this->addElement('text', 'username', array(
'label' => 'Username:',
'attribs' => array(
'maxlength' => 100,
'size' => 60
),
'validators' => array(
array('StringLength', false, array(3,25))
),
'required' => true
));
$this->addElement('password', 'password', array(
'label' => 'Password:',
'attribs' => array(
'maxlength' => 100,
'size' => 60
),
'validators' => array(
array('StringLength', false, array(6,100)),
),
'required' => true
));
$this->addElement('submit', 'submit', array(
'label' => 'Login'
));
$this->addDisplayGroup(
array('username','password', 'submit'),
'userlogin',
array(
'legend' => 'User Login'
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment