Skip to content

Instantly share code, notes, and snippets.

@gpfiel
Created March 10, 2014 15:07
Show Gist options
  • Save gpfiel/9466750 to your computer and use it in GitHub Desktop.
Save gpfiel/9466750 to your computer and use it in GitHub Desktop.
Form
<?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