Skip to content

Instantly share code, notes, and snippets.

@gpfiel
Created January 30, 2014 11:51
Show Gist options
  • Save gpfiel/8706958 to your computer and use it in GitHub Desktop.
Save gpfiel/8706958 to your computer and use it in GitHub Desktop.
Login form
<?php
namespace Application\Form;
use Zend\Form\Form;
class LoginForm extends Form
{
public function __construct($name = null)
{
parent::__construct('login-form');
$this->setAttribute('method', 'post');
$this->add(array(
'type' => 'Zend\Form\Element\Email',
'name' => 'email',
'attributes' => array(
'type' => 'text',
'class' => 'form-control placeholder',
'placeholder' => "Informe seu email",
"data-id" => "email",
"id" => "email",
"tabindex" => 1,
"style" => "height:50px; border-bottom:1px solid #ececec;"
),
'options' => array(
'label' => 'Login',
),
));
$this->add(array(
'name' => 'senha',
'attributes' => array(
'type' => 'password',
'class' => 'form-control placeholder',
'placeholder' => "Informe sua senha",
"data-id" => "senha",
"id" => "senha",
"tabindex" => 2,
"style" => "height:50px; border-bottom:1px solid #ececec"
),
'options' => array(
'label' => 'Senha',
),
));
$this->add(array(
'type' => 'Zend\Form\Element\Checkbox',
'name' => 'manter_logado',
'options' => array(
'use_hidden_element' => true,
'checked_value' => 1,
'unchecked_value' => 0
),
'attributes' => array(
'type' => 'checkbox',
"id" => "manter_logado",
"tabindex" => 3,
)
));
$this->add(array(
'name' => 'submit',
'attributes' => array(
'type' => 'submit',
'value' => 'Acessar',
'id' => 'submitbutton',
'class' => 'btn btn-acesso pull-right col-md-12',
"tabindex" => 4,
)
));
$this->add(array(
'type' => 'Zend\Form\Element\Csrf',
'name' => 'csrf',
'attributes' => array(
'id' => 'csrf',
)
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment