Esempio n. 1
0
 /**
  * @param null $name
  * @param array $options
  */
 public function __construct($name = null, $options = array())
 {
     parent::__construct('user', $options);
     $this->setAttribute('method', 'post');
     $email = new \Zend\Form\Element\Email('email');
     $email->setLabel('Email: ')->setAttribute('placeholder', 'Entre com o email');
     $this->add($email);
     $password = new \Zend\Form\Element\Password('password');
     $password->setLabel('Senha: ')->setAttribute('placeholder', 'Entre com a senha');
     $this->add($password);
     $this->add(array('name' => 'submit', 'type' => 'Zend\\Form\\Element\\Submit', 'attributes' => array('value' => 'Entrar', 'class' => 'btn-success')));
 }
 public function __construct($em)
 {
     parent::__construct('contact');
     $element = new \Zend\Form\Element\Text('prenom');
     $element->setLabel('Prénom');
     $this->add($element);
     $element = new \Zend\Form\Element\Text('nom');
     $element->setLabel('Nom');
     $this->add($element);
     $element = new \Zend\Form\Element\Email('email');
     $element->setLabel('Email');
     $this->add($element);
     $element = new \Zend\Form\Element\Text('telephone');
     $element->setLabel('Téléphone');
     $this->add($element);
     $this->add(array('type' => 'DoctrineModule\\Form\\Element\\ObjectSelect', 'name' => 'societe', 'options' => array('label' => 'Société', 'object_manager' => $em, 'target_class' => \AddressBook\Entity\Societe::class, 'property' => 'nom', 'display_empty_item' => true, 'empty_item_label' => '-- Pas de société --')));
     //        $element = new \Zend\Form\Element\Submit('submit');
     //        $element->setValue('Ajouter');
     //        $this->add($element);
 }
Esempio n. 3
0
 /**
  * @param null $name
  * @param array $options
  */
 public function __construct($name = null, $options = array())
 {
     $this->setInputFilter(new UserFilter());
     parent::__construct('user', $options);
     $this->setAttribute('method', 'post');
     $id = new \Zend\Form\Element\Hidden('id');
     $this->add($id);
     $nome = new \Zend\Form\Element\Text('nome');
     $nome->setLabel('Nome: ')->setAttribute('placeholder', 'Entre com o nome');
     $this->add($nome);
     $email = new \Zend\Form\Element\Email('email');
     $email->setLabel('Email: ')->setAttribute('placeholder', 'Entre com o email');
     $this->add($email);
     $password = new \Zend\Form\Element\Password('password');
     $password->setLabel('Senha: ')->setAttribute('placeholder', 'Entre com a senha');
     $this->add($password);
     $confirmation = new \Zend\Form\Element\Password('confirmation');
     $confirmation->setLabel('Redigite sua Senha: ')->setAttribute('placeholder', 'Redigite a senha');
     $this->add($confirmation);
     $csrf = new \Zend\Form\Element\Csrf("security");
     $this->add($csrf);
     $this->add(array('name' => 'submit', 'type' => 'Zend\\Form\\Element\\Submit', 'attributes' => array('value' => 'Salvar', 'class' => 'btn-success')));
 }