Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created November 8, 2012 12:14
Show Gist options
  • Select an option

  • Save eminetto/4038450 to your computer and use it in GitHub Desktop.

Select an option

Save eminetto/4038450 to your computer and use it in GitHub Desktop.
<?php
namespace Admin\Form;
use Zend\Form\Form;
class User extends Form
{
public function __construct()
{
parent::__construct('user');
$this->setAttribute('method', 'post');
$this->setAttribute('action', '/admin/user/save');
$this->add(array(
'name' => 'id',
'attributes' => array(
'type' => 'hidden',
),
));
$this->add(array(
'name' => 'name',
'attributes' => array(
'type' => 'text',
),
'options' => array(
'label' => 'Nome',
),
));
$this->add(array(
'name' => 'username',
'attributes' => array(
'type' => 'text',
),
'options' => array(
'label' => 'Username',
),
));
$this->add(array(
'name' => 'password',
'attributes' => array(
'type' => 'password',
),
'options' => array(
'label' => 'Senha',
),
));
$this->add(array(
'name' => 'role',
'attributes' => array(
'type' => 'text',
),
'options' => array(
'label' => 'Papel',
),
));
$this->add(array(
'name' => 'submit',
'attributes' => array(
'type' => 'submit',
'value' => 'Enviar',
'id' => 'submitbutton',
),
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment