/** * @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; }
/** * 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); }
/** * @param string $style * @return $this */ public function style($style = null) { if ($style) { $this->presenter->setStyle($this->config->get('styles.' . $style)); } return $this; }
/** * @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; }