Created
October 5, 2015 20:00
-
-
Save ricardofiorani/b65fe7a5093bd12fdd00 to your computer and use it in GitHub Desktop.
Fábio <3
This file contains hidden or 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 | |
| /** | |
| * Created by PhpStorm. | |
| * User: Ricardo Fiorani | |
| * Date: 01/10/2015 | |
| * Time: 18:23 | |
| */ | |
| namespace Dificiometro\Application\Form; | |
| use Zend\Form\Fieldset; | |
| class PostFieldset extends Fieldset | |
| { | |
| public function init() | |
| { | |
| $this->add(array( | |
| 'name' => 'name', | |
| 'type' => 'Zend\Form\Element\Text', | |
| )); | |
| $this->add(array( | |
| 'name' => 'text', | |
| 'type' => 'Zend\Form\Element\Textarea', | |
| )); | |
| $this->add(array( | |
| 'name' => 'category', | |
| 'type' => 'DoctrineModule\Form\Element\ObjectSelect', | |
| 'options' => array( | |
| 'target_class' => 'Dificiometro\Application\Entity\Category', | |
| 'property' => 'name', | |
| ), | |
| )); | |
| } | |
| } |
This file contains hidden or 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 | |
| /** | |
| * Created by PhpStorm. | |
| * User: Ricardo Fiorani | |
| * Date: 01/10/2015 | |
| * Time: 17:10 | |
| */ | |
| namespace Dificiometro\Application\Form; | |
| use Zend\Form\Form; | |
| class PostForm extends Form | |
| { | |
| public function init() | |
| { | |
| $this->add(array( | |
| 'name' => 'post', | |
| 'type' => 'Dificiometro\Application\Form\PostFieldset', | |
| 'hydrator' => 'DoctrineModule\Stdlib\Hydrator\DoctrineObject', | |
| 'object' => 'Dificiometro\Application\Entity\Post', | |
| )); | |
| $this->add(array( | |
| 'name' => 'submit', | |
| 'type' => 'Zend\Form\Element\Submit', | |
| )); | |
| $this->add(array( | |
| 'name' => 'csrf', | |
| 'type' => 'Zend\Form\Element\Csrf' | |
| )); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment