示例#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
 /**
  * @return array|string
  */
 protected function getValue()
 {
     if (isset($this->forceValue)) {
         return $this->forceValue;
     }
     if ($this->open->isSubmitted()) {
         return $this->dataStore->getOldValue($this->name);
     }
     return isset($this->value) ? $this->value : $this->dataStore->getModelValue($this->name);
 }
示例#3
0
文件: Form.php 项目: laraplus/form
 /**
  * @param ArrayAccess $model
  * @return $this
  */
 public function model($model)
 {
     $this->dataStore->bind($model);
     return $this;
 }
示例#4
0
文件: Open.php 项目: laraplus/form
 /**
  * @return bool
  */
 public function isSubmitted()
 {
     return $this->data->getOldValue('_form') == $this->name;
 }