Пример #1
0
 public function __construct(ObjectManager $objectManager)
 {
     $this->setObjectManager($objectManager);
     parent::__construct(null);
     $this->setAttributes(array('method' => 'POST', 'accept-charset' => 'UTF-8', 'class' => 'form-horizontal'));
     //input Titulo
     $titulo = new Text('titulo');
     $titulo->setLabel('Titulo')->setAttributes(array('id' => 'nome', 'maxlength' => 80, 'class' => 'form-control'));
     $this->add($titulo);
     //input descri��o
     $descricao = new Textarea('descricao');
     $descricao->setLabel("Descricao")->setAttributes(array('id' => 'descricao', 'maxlength' => 150, 'class' => 'form-control'));
     $this->add($descricao);
     //input texto
     $texto = new Textarea('texto');
     $texto->setLabel('Texto')->setAttributes(array('id' => 'texto', 'class' => 'form-control'));
     $this->add($texto);
     //input Ativo
     $ativo = new Checkbox('ativo');
     $ativo->setLabel('Ativo')->setLabelAttributes(array('class' => 'checkbox-inline'))->setOptions(array('use_hidden_element' => true));
     $this->add($ativo);
     //Categoria
     $categoria = new ObjectSelect('category');
     $categoria->setLabel('Categoria')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Categoria\\Entity\\Category', 'property' => 'nome', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('nome' => 'ASC')))))->setAttributes(array('id' => 'category', 'class' => 'form-control'));
     $this->add($categoria);
     //botao submit
     $button = new Button('submit');
     $button->setLabel('Salvar')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-default'));
     $this->add($button);
     $this->setInputFilter(new PostFilter($categoria->getValueOptions()));
 }
Пример #2
0
 /**
  * LancamentosForm constructor.
  * @param ObjectManager $objectManager
  */
 public function __construct(ObjectManager $objectManager)
 {
     $this->setObjectManager($objectManager);
     parent::__construct(null);
     $this->setAttribute('method', 'POST');
     $this->setAttribute('class', 'form-horizontal');
     $prioridade = new ObjectSelect('prioridade');
     $prioridade->setLabel('Prioridade')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Prioridade\\Entity\\Prioridade', 'property' => 'name', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('name' => 'ASC')))))->setAttributes(array('class' => 'form-control'));
     $this->add($prioridade);
     $categoria = new ObjectSelect('categoria');
     $categoria->setLabel('Categoria')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Categoria\\Entity\\Categoria', 'property' => 'name', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('name' => 'ASC')))))->setAttributes(array('class' => 'form-control'));
     $this->add($categoria);
     $operacao = new ObjectSelect('operacao');
     $operacao->setLabel('Operacoes')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Operacoes\\Entity\\Operacoes', 'property' => 'name', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('name' => 'ASC')))))->setAttributes(array('class' => 'form-control'));
     $this->add($operacao);
     $origem = new ObjectSelect('origem');
     $origem->setLabel('Origem')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Origem\\Entity\\Origem', 'property' => 'name', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('name' => 'ASC')))))->setAttributes(array('class' => 'form-control'));
     $this->add($origem);
     //Input Saldo Inicial
     $valorInicial = new Text('valorInicial');
     $valorInicial->setLabel('Valor Inicial')->setAttributes(array('maxlength' => 10, 'class' => 'form-control'));
     $this->add($valorInicial);
     //Input Saldo Inicial
     $valorFinal = new Text('valorFinal');
     $valorFinal->setLabel('Valor Final')->setAttributes(array('maxlength' => 10, 'class' => 'form-control'));
     $this->add($valorFinal);
     $tipo = new ObjectSelect('tipo');
     $tipo->setLabel('Tipo')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Tipo\\Entity\\Tipo', 'property' => 'name', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('name' => 'ASC')))))->setAttributes(array('class' => 'form-control'));
     $this->add($tipo);
     //Botao submit
     $button = new Button('submit');
     $button->setAttributes(array('type' => 'submit', 'class' => 'btn btn-success', 'value' => 'Salvar'));
     $this->add($button);
     $this->setInputFilter(new LancamentosFilter($categoria->getValueOptions(), $operacao->getValueOptions(), $origem->getValueOptions(), $tipo->getValueOptions(), $prioridade->getValueOptions()));
 }
Пример #3
0
 public function __construct(ObjectManager $objectManager)
 {
     $this->setObjectManager($objectManager);
     parent::__construct(null);
     $this->setAttribute('method', 'POST');
     $this->setAttribute('class', 'form-horizontal');
     //Input Titulo
     $titulo = new Text('titulo');
     $titulo->setLabel('Titulo')->setAttributes(array('maxlength' => 80));
     $this->add($titulo);
     //Input Descrição
     $descricao = new Textarea('descricao');
     $descricao->setLabel('descriçao')->setAttributes(array('maxlength' => 150));
     $this->add($descricao);
     //Input Titulo
     $texto = new Textarea('texto');
     $texto->setLabel('Texto');
     $this->add($texto);
     $ativo = new Checkbox('ativo');
     $ativo->setLabel('Ativo');
     $this->add($ativo);
     $categoria = new ObjectSelect('category');
     $categoria->setLabel('Categoria')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => '\\Base\\Orm\\Entities\\Category', 'property' => 'nome', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('nome' => 'ASC')))));
     $this->add($categoria);
     //Botao submit
     $button = new Button('submit');
     $button->setLabel('Salvar')->setAttributes(array('type' => 'submit', 'class' => 'btn'));
     $this->add($button);
     $this->setInputFilter(new PostFilter($categoria->getValueOptions()));
 }
 public function __construct(ObjectManager $objectManager)
 {
     $this->setObjectManager($objectManager);
     parent::__construct(null);
     $this->setAttributes(array('method' => 'POST', 'accept-charset' => 'UTF-8', 'class' => 'form-horizontal'));
     //input Titulo
     $nome = new Text('nome');
     $nome->setLabel('Nome')->setAttributes(array('id' => 'nome', 'maxlength' => 80, 'class' => 'form-control'));
     $this->add($nome);
     //input email
     $email = new Text('email');
     $email->setLabel("email")->setAttributes(array('id' => 'email', 'maxlength' => 150, 'class' => 'form-control'));
     $this->add($email);
     //nivel_id
     $nivel = new ObjectSelect('nivel');
     $nivel->setLabel('Nivel')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Nivel\\Entity\\Nivel', 'property' => 'nome', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('nome' => 'ASC')))))->setAttributes(array('id' => 'nivel', 'class' => 'form-control'));
     $this->add($nivel);
     //login_id
     $login = new Text('login');
     $login->setLabel('Login')->setAttributes(array('id' => 'login', 'maxlength' => 45, 'class' => 'form-control'))->setLabelAttributes(array());
     $this->add($login);
     //botao submit
     $button = new Button('submit');
     $button->setLabel('Salvar')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-default'));
     $this->add($button);
     $this->setInputFilter(new UsuarioEditFilter($nivel->getValueOptions()));
 }
 public function __construct(ServiceLocatorInterface $serviceLocator, ObjectManager $objectManager)
 {
     parent::__construct('user-form');
     $this->setAttribute('class', 'form-horizontal');
     /** @var \Application\Filter\UserFilter $userFilter */
     $userFilter = $serviceLocator->get("user-filter");
     $this->setInputFilter($userFilter);
     $this->setObjectManager($objectManager);
     $translator = $serviceLocator->get('translator');
     $id = new Hidden('id');
     $this->add($id);
     $first_name = new Text('firstname');
     $first_name->setLabel($translator->translate('First Name'))->setAttributes(['id' => 'user_first_name', 'class' => 'form-control input-circle']);
     $this->add($first_name);
     $last_name = new Text('lastname');
     $last_name->setLabel($translator->translate('Last Name'))->setAttributes(['id' => 'user_last_name', 'class' => 'form-control input-circle']);
     $this->add($last_name);
     $username = new Text('username');
     $username->setLabel($translator->translate('Username'))->setAttributes(['id' => 'user_username', 'class' => 'form-control input-circle']);
     $this->add($username);
     $email = new Email('email');
     $email->setLabel($translator->translate('E-mail'))->setAttributes(['id' => 'user_email', 'class' => 'form-control input-circle']);
     $this->add($email);
     $password = new Password('password');
     $password->setLabel($translator->translate('Password'))->setAttributes(['id' => 'user_password', 'class' => 'form-control input-circle', 'placeholder' => $translator->translate('Report to Update')]);
     $this->add($password);
     $level = new Select('level');
     $level->setLabel($translator->translate('Level'))->setAttributes(['id' => 'user_level', 'class' => 'form-control select2me', 'options' => ['1' => $translator->translate('Super Admin'), '2' => $translator->translate('Admin'), '3' => $translator->translate('User')]]);
     $this->add($level);
     $ps = new Textarea('ps');
     $ps->setLabel($translator->translate('PS'))->setAttributes(['id' => 'user_ps', 'class' => 'form-control input-circle', 'rows' => 5]);
     $this->add($ps);
     $language = new ObjectSelect('language');
     $language->setLabel($translator->translate('Language'))->setAttributes(['id' => 'language', 'class' => 'form-control select2me'])->setOptions(['object_manager' => $this->getObjectManager(), 'target_class' => 'Application\\Entity\\WcLanguage', 'property' => 'name', 'empty_option' => $translator->translate('Select one Language'), 'is_method' => TRUE, 'find_method' => ['name' => 'findBy', 'params' => ['criteria' => [], 'orderBy' => ['name' => 'ASC']]]]);
     $this->add($language);
     $status = new Select('status');
     $status->setLabel($translator->translate('Status'))->setAttributes(['id' => 'user_status', 'class' => 'form-control select2me', 'options' => ['1' => $translator->translate('Active'), '0' => $translator->translate('Desactive')]]);
     $this->add($status);
     $submit = new Button('submit');
     $submit->setLabel($translator->translate('Save'))->setAttributes(['type' => 'submit', 'class' => 'btn-primary btn btn-circle pull-right ml-xs send']);
     $this->add($submit);
 }