More Blade improvements… adds template inheritance.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
@@ -73,7 +73,18 @@ class View implements ArrayAccess {
|
||||
{
|
||||
$this->view = $view;
|
||||
$this->data = $data;
|
||||
$this->path = $this->path($view);
|
||||
|
||||
// In order to allow developers to load views outside of the normal loading
|
||||
// conventions, we'll allow for a raw path to be given in place of the
|
||||
// typical view name, giving total freedom on view loading.
|
||||
if (starts_with($view, 'path: '))
|
||||
{
|
||||
$this->path = substr($view, 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->path = $this->path($view);
|
||||
}
|
||||
|
||||
// If a session driver has been specified, we will bind an instance of the
|
||||
// validation error message container to every view. If an error instance
|
||||
@@ -327,7 +338,7 @@ class View implements ArrayAccess {
|
||||
/**
|
||||
* Get the array of view data for the view instance.
|
||||
*
|
||||
* The shared view data will be combined with the view data for the instance.
|
||||
* The shared view data will be combined with the view data.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@@ -381,7 +392,15 @@ class View implements ArrayAccess {
|
||||
*/
|
||||
public function with($key, $value)
|
||||
{
|
||||
$this->data[$key] = $value;
|
||||
if (is_array($key))
|
||||
{
|
||||
$this->data = array_merge($this->data, $key);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->data[$key] = $value;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user