cleaning up code.
This commit is contained in:
parent
f6ef233d39
commit
353c7c527f
|
@ -237,8 +237,7 @@ protected function data()
|
||||||
|
|
||||||
// All nested views and responses are evaluated before the main view.
|
// All nested views and responses are evaluated before the main view.
|
||||||
// This allows the assets used by nested views to be added to the
|
// This allows the assets used by nested views to be added to the
|
||||||
// asset container before the main view is evaluated and dumps
|
// asset container before the main view is evaluated.
|
||||||
// the links to the assets into the HTML.
|
|
||||||
foreach ($data as &$value)
|
foreach ($data as &$value)
|
||||||
{
|
{
|
||||||
if ($value instanceof View or $value instanceof Response)
|
if ($value instanceof View or $value instanceof Response)
|
||||||
|
@ -259,14 +258,12 @@ protected function compile()
|
||||||
{
|
{
|
||||||
// Compiled views are stored in the storage directory using the MD5
|
// Compiled views are stored in the storage directory using the MD5
|
||||||
// hash of their path. This allows us to easily store the views in
|
// hash of their path. This allows us to easily store the views in
|
||||||
// the directory without worrying about re-creating the entire
|
// the directory without worrying about structure.
|
||||||
// application view directory structure.
|
|
||||||
$compiled = path('storage').'views/'.md5($this->path);
|
$compiled = path('storage').'views/'.md5($this->path);
|
||||||
|
|
||||||
// The view will only be re-compiled if the view has been modified
|
// The view will only be re-compiled if the view has been modified
|
||||||
// since the last compiled version of the view was created or no
|
// since the last compiled version of the view was created or no
|
||||||
// compiled view exists. Otherwise, the path will be returned
|
// compiled view exists at all in storage.
|
||||||
// without re-compiling the view.
|
|
||||||
if ( ! file_exists($compiled) or (filemtime($this->path) > filemtime($compiled)))
|
if ( ! file_exists($compiled) or (filemtime($this->path) > filemtime($compiled)))
|
||||||
{
|
{
|
||||||
file_put_contents($compiled, Blade::compile($this->path));
|
file_put_contents($compiled, Blade::compile($this->path));
|
||||||
|
|
Loading…
Reference in New Issue