Пример #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;
 }
Пример #2
0
 /**
  * @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
 /**
  * @param ArrayAccess $model
  * @return $this
  */
 public function model($model)
 {
     $this->dataStore->bind($model);
     return $this;
 }
Пример #4
0
 /**
  * @return bool
  */
 public function isSubmitted()
 {
     return $this->data->getOldValue('_form') == $this->name;
 }