some small refactorings and cleanup.

This commit is contained in:
Taylor Otwell
2011-10-22 23:25:07 -05:00
parent b71ecb4363
commit 32989d39c8
9 changed files with 45 additions and 51 deletions

View File

@@ -123,8 +123,7 @@ class View {
/**
* Find the key for a view by name.
*
* The view's key can be used to create instances of the view through the typical
* methods available on the view factory.
* The view "key" is the string that should be passed into the "make" method.
*
* @param string $name
* @return string
@@ -133,9 +132,6 @@ class View {
{
if (is_null(static::$composers)) static::$composers = require APP_PATH.'composers'.EXT;
// The view's name may specified in several different ways in the composers
// file. The composer may simple have a string value, which is the name.
// Or, it may an array value in which a "name" key exists.
foreach (static::$composers as $key => $value)
{
if ($name === $value or (is_array($value) and $name === Arr::get($value, 'name')))
@@ -215,7 +211,7 @@ class View {
// without re-compiling.
if ((file_exists($compiled) and filemtime($this->path) > filemtime($compiled)) or ! file_exists($compiled))
{
file_put_contents($compiled, Blade::parse($this->path));
file_put_contents($compiled, Blade::compile($this->path));
}
return $compiled;