fixing bugs and refactoring.
This commit is contained in:
@@ -133,10 +133,9 @@ 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, the composer could have an array
|
||||
// value in which a "name" key exists.
|
||||
// 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'))) return $key;
|
||||
@@ -177,7 +176,10 @@ class View {
|
||||
// main view is evaluated and dumps the links to the assets.
|
||||
foreach ($this->data as &$data)
|
||||
{
|
||||
if ($data instanceof View or $data instanceof Response) $data = $data->render();
|
||||
if ($data instanceof View or $data instanceof Response)
|
||||
{
|
||||
$data = $data->render();
|
||||
}
|
||||
}
|
||||
|
||||
ob_start() and extract($this->data, EXTR_SKIP);
|
||||
|
||||
Reference in New Issue
Block a user