Created
March 10, 2014 15:07
-
-
Save gpfiel/9466750 to your computer and use it in GitHub Desktop.
Form
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 | |
namespace Admin\Form; | |
use Zend\Form\Form; | |
use Zend\InputFilter\InputFilterProviderInterface; | |
class GaleriaForm extends Form implements InputFilterProviderInterface | |
{ | |
public function init() | |
{ | |
$this->setAttribute('method', 'post'); | |
$this->setAttribute('class', 'stdform'); | |
$this->add([ | |
"name" => "galeria", | |
'type' => 'Zend\Form\Fieldset', | |
'object' => 'Admin\Entity\Galeria', | |
'hydrator' => 'DoctrineModule\Stdlib\Hydrator\DoctrineObject', | |
'options' => [ | |
'use_as_base_fieldset' => true, | |
], | |
'elements' => [ | |
[ | |
'name' => 'id', | |
'attributes' => [ | |
'type' => 'hidden', | |
], | |
], | |
[ | |
'name' => 'nome', | |
'type' => 'text', | |
'options' => [ | |
'label' => 'Nome', | |
'class' => 'input-xlarge', | |
], | |
], | |
], | |
]); | |
$this->add([ | |
'name' => 'submit', | |
'attributes' => [ | |
'type' => 'submit', | |
'value' => 'Go', | |
'id' => 'submitbutton', | |
'class' => 'btn btn-primary btn-rounded span2' | |
], | |
]); | |
} | |
public function getInputFilterSpecification() | |
{ | |
return ['type' => 'Admin\InputFilter\GaleriaInputFilter']; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment