Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Cadastro\Form;
- use Zend\Form\Form;
- use Zend\InputFilter\InputFilterProviderInterface;
- use Zend\Form\Element\Submit;
- use Zend\Form\Element\Text;
- use Application\Hydrator\ObjectHydrator;
- /**
- * Cadastro de custas
- *
- * @author Alfredo Costa
- * @category Form
- * @package Cadastro/Form
- * @copyright 2014 P21 Sistemas
- * @version 1.0.0
- */
- class EncargoVigenciaForm extends Form implements InputFilterProviderInterface
- {
- /**
- */
- public function __construct($objectManager)
- {
- parent::__construct('custas');
- $this->setHydrator(new ObjectHydrator($objectManager))->setObject(new \Cadastro\Entity\EncargoVigencia());
- $this->add(array(
- 'type' => 'Zend\Form\Element\Hidden',
- 'name' => 'id'
- ));
- // COMBO
- $this->add(array(
- 'type' => 'DoctrineModule\Form\Element\ObjectSelect',
- 'name' => 'encargo',
- 'options' => array(
- 'label' => 'Encargo',
- 'object_manager' => $objectManager,
- 'target_class' => 'Cadastro\Entity\Encargo',
- 'display_empty_item' => true,
- 'label_generator' => function ($encargo)
- {
- return $encargo->getNome();
- },
- 'is_method' => true,
- 'find_method' => array(
- 'name' => 'findBy',
- 'params' => array(
- 'criteria' => array(),
- 'orderBy' => array(
- 'nome' => 'ASC'
- )
- )
- )
- ),
- 'attributes' => array(
- 'class' => 'form-control',
- 'id' => 'encargo'
- )
- ));
- $this->add(array(
- 'type' => 'Zend\Form\Element\Collection',
- 'name' => 'valores',
- 'options' => array(
- 'label' => 'Valores',
- 'count' => 1,
- 'target_element' => new EncargoValorFieldset($objectManager)
- )
- ));
- $this->add(array(
- 'type' => 'Zend\Form\Element\Date',
- 'name' => 'dataVigencia',
- 'options' => array(
- 'label' => 'Data vigรชncia',
- 'format' => 'd/m/Y'
- ),
- 'attributes' => array(
- 'class' => 'form-control form-control-inline input-medium date-picker'
- )
- ));
- $this->add(array(
- 'type' => 'Zend\Form\Element\Submit',
- 'name' => 'confirmar',
- 'attributes' => array(
- 'class' => 'btn blue',
- 'value' => 'Confirmar'
- )
- ));
- $this->add(array(
- 'type' => 'Zend\Form\Element\Submit',
- 'name' => 'cancelar',
- 'attributes' => array(
- 'class' => 'btn default',
- 'value' => 'Cancelar'
- )
- ));
- }
- public function getInputFilterSpecification()
- {
- return array();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement