diff --git a/src/Controller/Action.php b/src/Controller/Action.php index f60c242..6e314e2 100644 --- a/src/Controller/Action.php +++ b/src/Controller/Action.php @@ -336,6 +336,7 @@ class Controller_Action $node->make($this); $this->view->setView($name, $node->view); } + foreach ($this->childViews as $name => $node) { $this->view->setView($name, $node); } diff --git a/src/View/Top.php b/src/View/Top.php index a27df4c..bd35017 100644 --- a/src/View/Top.php +++ b/src/View/Top.php @@ -74,6 +74,9 @@ class View_Top extends View_Composite { $startup = array(); foreach($this->_section as $s) { + if (is_string($s)) { + continue; + } $module = explode('_', $s->active_module, 2); if (count($module) < 2) { continue; @@ -106,7 +109,6 @@ class View_Top extends View_Composite { $script .= $value . ".execute('" . $s->module_action . "', " . json_encode($init) .");\n"; $startup[] = $script; - } diff --git a/src/View/View.php b/src/View/View.php index 85d9961..b54079e 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -1,6 +1,5 @@ View_Base + View_List + View_Template class View_View { protected $_section = array(); // Вложенные шаблоны @@ -31,10 +30,12 @@ class View_View * @param string $section переменная шаблона * @param CompositeView $view вложенный шаблон */ - public function setView($section, View_View $view) + public function setView($section, /*View_View|string*/ $view) { $this->_section [$section] = $view; - $view->parent_view = $this; + if (is_object($view)) { + $view->parent_view = $this; + } } public function assignValues($values)