Example #1
0
 /**
  * (non-PHPdoc)
  * @see \vxPHP\Form\FormElement\InputElement::render()
  */
 public function render($force = FALSE)
 {
     if (empty($this->html) || $force) {
         $this->attributes['type'] = 'submit';
         $this->html = parent::render(TRUE);
     }
     return $this->html;
 }
Example #2
0
 /**
  * (non-PHPdoc)
  * @see \vxPHP\Form\FormElement\InputElement::render()
  */
 public function render($force = FALSE)
 {
     if (empty($this->html) || $force) {
         if ($this->checked) {
             $this->attributes['checked'] = 'checked';
         } else {
             unset($this->attributes['checked']);
         }
         $this->attributes['type'] = 'checkbox';
         $this->html = parent::render(TRUE) . ($this->label ? sprintf('<label>%s</label>', $this->label) : '');
     }
     return $this->html;
 }
Example #3
0
 /**
  * render CSRF token element
  * the token will use the form action as id
  * 
  * @return string
  */
 private function renderCsrfToken()
 {
     $tokenManager = new CsrfTokenManager();
     $token = $tokenManager->refreshToken('_' . $this->action . '_');
     $e = new InputElement(self::CSRF_TOKEN_NAME, $token->getValue());
     $e->setAttribute('type', 'hidden');
     return $e->render();
 }
Example #4
0
 /**
  * (non-PHPdoc)
  * @see \vxPHP\Form\FormElement\InputElement::render()
  */
 public function render($force = FALSE)
 {
     $this->attributes['type'] = 'image';
     return parent::render($force);
 }