Пример #1
0
 public function __construct($name = null, $options = array())
 {
     parent::__construct($name, $options);
     $this->setAttribute('method', 'post');
     $email = new \Zend\Form\Element\Text("email");
     $email->setLabel("Email: ")->setAttribute('placeholder', 'Email')->setAttribute('class', 'form-control');
     $this->add($email);
     $password = new \Zend\Form\Element\Password("password");
     $password->setLabel("Password: "******"submit");
     $submit->setAttribute('value', 'Entrar')->setAttribute('class', 'btn btn-primary btn-block btn-flat');
     $this->add($submit);
 }
Пример #2
0
 /**
  * @param \Secretary\Entity\User $user
  * @param string                 $action
  */
 public function __construct(\Secretary\Entity\User $user, $action = '#')
 {
     parent::__construct('userForm');
     $this->setAttribute('method', 'post')->setAttribute('action', $action)->setAttribute('class', 'form-horizontal');
     $displayName = new \Zend\Form\Element\Text('display_name');
     $displayName->setAttribute('required', 'required')->setAttribute('label', 'Display Name')->setValue($user->getDisplayName());
     $this->add($displayName);
     $select = new \Zend\Form\Element\Select('language');
     $select->setAttribute('required', 'required')->setAttribute('label', 'Select Language')->setValueOptions(array('de_DE' => 'german', 'en_US' => 'english'))->setValue($user->getLanguage());
     $this->add($select);
     $notifications = new \Zend\Form\Element\Select('notifications');
     $notifications->setAttribute('required', 'required')->setAttribute('label', 'Enable notifications')->setValueOptions(array('0' => 'no', '1' => 'yes'))->setValue($user->getNotifications());
     $this->add($notifications);
     $submit = new \Zend\Form\Element\Submit('submit');
     $submit->setAttribute('class', 'btn btn-primary')->setAttribute('value', 'save');
     $this->add($submit);
 }