Ejemplo n.º 1
0
 /**
  * @return string
  */
 public function __toString()
 {
     if ($this->open->bare) {
         return '';
     }
     $tag = $this->presenter->renderClosingTag($this);
     if ($this->token) {
         $tag = '<input type="hidden" name="_token" value="' . $this->data->getToken() . '" />' . $tag;
     }
     return $tag;
 }
Ejemplo n.º 2
0
 /**
  * Inject the element into presenter
  */
 protected function initPresenter()
 {
     if ($this->name && $this->open->isSubmitted()) {
         $this->error = $this->dataStore->getError($this->name);
     }
     $this->presenter->setElement($this);
 }
Ejemplo n.º 3
0
 /**
  * @param string $style
  * @return $this
  */
 public function style($style = null)
 {
     if ($style) {
         $this->presenter->setStyle($this->config->get('styles.' . $style));
     }
     return $this;
 }
Ejemplo n.º 4
0
 /**
  * @return string
  */
 public function __toString()
 {
     $append = '<input type="hidden" name="_form" value="' . $this->name . '" />';
     if ($this->bare) {
         return $append;
     }
     if (!in_array($this->attributes['method'], ['GET', 'POST'])) {
         $append .= '<input type="hidden" name="_method" value="' . $this->attributes['method'] . '" />';
         $this->attributes['method'] = 'POST';
     }
     return $this->presenter->renderOpeningTag($this) . $append;
 }