Fix bug in form builder.

This commit is contained in:
Taylor Otwell committed 2013-05-02 07:37:25 -05:00
1 parent 72ed9898cb
commit fa7d41c987
1 file changed
+18
+18
View File
@@ -727,9 +727,27 @@ class FormBuilder {
if ( ! is_null($value)) return $value; if ( ! is_null($value)) return $value;
if (isset($this->model) and isset($this->model[$name])) 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); return object_get($this->model, $name);
} }
elseif (is_array($this->model))
{
return array_get($this->model, $name);
}
} }
/** /**