Fix bug in form builder.
This commit is contained in:
1 parent
72ed9898cb
commit
fa7d41c987
1 file changed
+18
@@ -727,9 +727,27 @@ class FormBuilder {
|
||||
if ( ! is_null($value)) return $value;
|
||||
|
||||
if (isset($this->model) and isset($this->model[$name]))
|
||||
{
|
||||
return $this->getModelValueAttribute($name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the model value that should be assigned to the field.
|
||||
*
|
||||
* @param string $name
|
||||
* @return string
|
||||
*/
|
||||
protected function getModelValueAttribute($name)
|
||||
{
|
||||
if (is_object($this->model))
|
||||
{
|
||||
return object_get($this->model, $name);
|
||||
}
|
||||
elseif (is_array($this->model))
|
||||
{
|
||||
return array_get($this->model, $name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user