Exemplo n.º 1
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);
 }
 /**
  * {@inheritDoc}
  */
 public function getDisplayName()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDisplayName', array());
     return parent::getDisplayName();
 }