Commit fa3ec4d7 by Taylor Otwell

Refactoring the view class.

parent d8d0ddfa
...@@ -115,10 +115,7 @@ class View { ...@@ -115,10 +115,7 @@ class View {
$path = ($module == 'application') ? VIEW_PATH : MODULE_PATH.$module.'/views/'; $path = ($module == 'application') ? VIEW_PATH : MODULE_PATH.$module.'/views/';
if ($module != 'application') if ($module != 'application') $view = substr($view, strpos($view, ':') + 2);
{
$view = substr($view, strpos($view, ':') + 2);
}
return array($module, $path, $view); return array($module, $path, $view);
} }
...@@ -193,7 +190,10 @@ class View { ...@@ -193,7 +190,10 @@ class View {
throw new \Exception("View [$view] does not exist."); throw new \Exception("View [$view] does not exist.");
} }
$this->get_sub_views(); foreach ($this->data as &$data)
{
if ($data instanceof View or $data instanceof Response) $data = (string) $data;
}
extract($this->data, EXTR_SKIP); extract($this->data, EXTR_SKIP);
...@@ -205,22 +205,6 @@ class View { ...@@ -205,22 +205,6 @@ class View {
} }
/** /**
* Evaluate all of the view and response instances that are bound to the view.
*
* @return void
*/
private function get_sub_views()
{
foreach ($this->data as &$data)
{
if ($data instanceof View or $data instanceof Response)
{
$data = (string) $data;
}
}
}
/**
* Add a view instance to the view data. * Add a view instance to the view data.
* *
* @param string $key * @param string $key
......
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