示例#1
0
 /**
  * Initialization
  *
  * @return void
  */
 public function init()
 {
     parent::init();
     $this->setMethod('post');
     $this->setDecorators(array('FormElements', 'Form', new FormErrors(array('placement' => 'prepend', 'markupListEnd' => '</div>', 'markupListItemEnd' => '</span>', 'markupListItemStart' => '<span>', 'markupListStart' => '<div class="form-errors messages error"><span class="message-icon"></span>'))));
     $this->_addUserAuthFieldset();
     $this->_addContactInfoFieldset();
 }
示例#2
0
 /**
  * Initialization
  *
  * @return void
  */
 public function init()
 {
     parent::init();
     $this->setName('userUpdateForm');
     $this->setMethod('post');
     $this->setDecorators(array('FormElements', 'Form', new FormErrors(array('placement' => 'prepend', 'markupListEnd' => '</div>', 'markupListItemEnd' => '</span>', 'markupListItemStart' => '<span>', 'markupListStart' => '<div class="form-errors messages error"><span class="message-icon"></span>'))));
     $this->_addContactInfoFieldset();
     // Add Submit button
     $this->addElement('submit', 'Update', array('required' => false, 'ignore' => true, 'label' => 'Update', 'decorators' => array('ViewHelper')));
 }
示例#3
0
 /**
  * Initialization
  *
  * @return void
  */
 public function init()
 {
     parent::init();
     $this->setName('userLostPasswordForm');
     $this->setMethod('post');
     /*
     $this->addElement('text', 'email', array(
       'filters'    => array('HtmlEntities', 'StringTrim', 'StringToLower'),
       'validators' => array(
         array('StringLength', false, array(1, 255)),
         'EmailAddress'
       ),
       'required'   => true,
       'label'  => 'Email address:',
     ));
     */
     $this->addElement('text', 'username', array('filters' => array('HtmlEntities', 'StringTrim', 'StringToLower'), 'validators' => array(array('StringLength', false, array(3, 20))), 'required' => true, 'label' => 'Username:'******'submit', 'submit', array('required' => false, 'ignore' => true, 'label' => 'Submit', 'decorators' => array('ViewHelper', array('HtmlTag', array('tag' => 'li', 'class' => 'align-content-center')))));
 }
示例#4
0
 /**
  * Set form field default values
  *
  * @param User $user
  * @return void
  */
 public function setDefaults(User $user)
 {
     $profile = $user->getProfile();
     parent::setDefaults(array('userId' => $user->getId(), 'username' => $user->getUsername(), 'role' => $user->getRole()->getId(), 'firstName' => $profile->getFirstName(), 'lastName' => $profile->getLastName(), 'email' => $user->getEmail(), 'phone' => $profile->getPhone(), 'active' => $user->getActive(), 'locked' => $user->getLocked()));
 }