Created
April 27, 2012 13:15
-
-
Save eminetto/2509106 to your computer and use it in GitHub Desktop.
Login form usando Zend_Dojo_Form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Application_Form_Login extends Zend_Dojo_Form | |
{ | |
public function init() | |
{ | |
$this->setName('Login'); | |
//elementos do Dojo | |
$this->addElement( | |
'ValidationTextBox', | |
'username', | |
array( | |
'label' => 'Login', | |
'required' => true, | |
'regExp' => '[\w]+', | |
'invalidMessage' => 'Não pode existir espaços.', | |
) | |
); | |
$this->addElement( | |
'PasswordTextBox', | |
'password', | |
array( | |
'label' => 'Senha', | |
'required' => true, | |
'trim' => true, | |
'lowercase' => true, | |
'regExp' => '^[a-z0-9]{3,}$', | |
'invalidMessage' => 'Senha inválida. Precisa ter no mínimo 3 caracteres', | |
) | |
); | |
$this->addElement( | |
'SubmitButton', | |
'enviar', | |
array( | |
'required' => false, | |
'ignore' => true, | |
'label' => 'Entrar!', | |
) | |
); | |
//action e method | |
$this->setAction('/auth/index')->setMethod('post'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment