示例#1
0
文件: Close.php 项目: laraplus/form
 /**
  * @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;
 }
示例#2
0
文件: Element.php 项目: laraplus/form
 /**
  * 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);
 }
示例#3
0
文件: Form.php 项目: laraplus/form
 /**
  * @param string $style
  * @return $this
  */
 public function style($style = null)
 {
     if ($style) {
         $this->presenter->setStyle($this->config->get('styles.' . $style));
     }
     return $this;
 }
示例#4
0
文件: Open.php 项目: laraplus/form
 /**
  * @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;
 }