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

cleaning up code.

parent f6ef233d
......@@ -237,8 +237,7 @@ class View implements ArrayAccess {
// All nested views and responses are evaluated before the main view.
// This allows the assets used by nested views to be added to the
// asset container before the main view is evaluated and dumps
// the links to the assets into the HTML.
// asset container before the main view is evaluated.
foreach ($data as &$value)
{
if ($value instanceof View or $value instanceof Response)
......@@ -259,14 +258,12 @@ class View implements ArrayAccess {
{
// Compiled views are stored in the storage directory using the MD5
// hash of their path. This allows us to easily store the views in
// the directory without worrying about re-creating the entire
// application view directory structure.
// the directory without worrying about structure.
$compiled = path('storage').'views/'.md5($this->path);
// 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
// compiled view exists. Otherwise, the path will be returned
// without re-compiling the view.
// compiled view exists at all in storage.
if ( ! file_exists($compiled) or (filemtime($this->path) > filemtime($compiled)))
{
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