Last active
August 29, 2015 14:02
-
-
Save eminetto/0dfea8a3ef47061fb742 to your computer and use it in GitHub Desktop.
This file contains 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 | |
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