Skip to content

Instantly share code, notes, and snippets.

@carlosfilho88
Last active August 29, 2015 14:08
Show Gist options
  • Save carlosfilho88/73f40807eec0592a80aa to your computer and use it in GitHub Desktop.
Save carlosfilho88/73f40807eec0592a80aa to your computer and use it in GitHub Desktop.
<?php
class Application_Form_Logindropdown extends Zend_Form {
public function init(){
$this->setMethod('post')
->setAction('/login')
->setEnctype('UTF-8');
$email = new Zend_Form_Element_Email('email');
$email->setAttrib('placeholder', 'Digite seu e-mail')
->setAttrib('class', 'input-large')
->setAttrib('required', '')
->setFilters(array('StringTrim', 'StringToLower'))
->setDecorators(array('ViewHelper'))
->setRequired(true);
$senha = new Zend_Form_Element_Password('senha');
$senha->setAttrib('placeholder', 'Digite sua senha')
->setAttrib('class', 'input-large')
->setAttrib('maxlength', 20)
->setAttrib('required', '')
->setValidators(array('Alnum',array('StringLength', false, array(5, 20, 'encoding' => 'UTF-8'))))
->setFilters(array('StringTrim'))
->setDecorators(array('ViewHelper'))
->setRequired(true);
$submit = new Zend_Form_Element_Submit('Entrar');
$submit->setIgnore(true)
->setAttrib('class', 'btn btn-success ladda-button')
->setAttrib('data-style', 'zoom-in')
->setAttrib('display', 'block')
->setDecorators(array('ViewHelper'));
$this->setDecorators(array('FormElements','Form'));
$this->addElements(array($email, $senha, $submit));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment