Skip to content

Instantly share code, notes, and snippets.

@eminetto
Last active August 29, 2015 14:02
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 eminetto/0dfea8a3ef47061fb742 to your computer and use it in GitHub Desktop.
Save eminetto/0dfea8a3ef47061fb742 to your computer and use it in GitHub Desktop.
<?php
namespace Application\Form;
use Zend\Form\Form;
class Post extends Form
{
public function __construct()
{
parent::__construct('post');
$this->setAttribute('method', 'post');
$this->setAttribute('action', '/post/save');
$this->add(array(
'name' => 'id',
'attributes' => array(
'type' => 'hidden',
),
));
$this->add(array(
'name' => 'title',
'attributes' => array(
'type' => 'text',
),
'options' => array(
'label' => 'Título',
),
));
$this->add(array(
'name' => 'description',
'attributes' => array(
'type' => 'textarea',
),
'options' => array(
'label' => 'Texto do post',
),
));
$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