Skip to content

Instantly share code, notes, and snippets.

@eminetto
Last active Aug 29, 2015
Embed
What would you like to do?
<?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