Commit 353c7c52 authored by Taylor Otwell's avatar Taylor Otwell

cleaning up code.

parent f6ef233d
...@@ -237,8 +237,7 @@ class View implements ArrayAccess { ...@@ -237,8 +237,7 @@ class View implements ArrayAccess {
// 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 @@ class View implements ArrayAccess { ...@@ -259,14 +258,12 @@ class View implements ArrayAccess {
{ {
// 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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment