View как строка
This commit is contained in:
parent
3a77f74177
commit
f30f7546d6
3 changed files with 8 additions and 4 deletions
|
|
@ -336,6 +336,7 @@ class Controller_Action
|
||||||
$node->make($this);
|
$node->make($this);
|
||||||
$this->view->setView($name, $node->view);
|
$this->view->setView($name, $node->view);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->childViews as $name => $node) {
|
foreach ($this->childViews as $name => $node) {
|
||||||
$this->view->setView($name, $node);
|
$this->view->setView($name, $node);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,9 @@ class View_Top extends View_Composite {
|
||||||
|
|
||||||
$startup = array();
|
$startup = array();
|
||||||
foreach($this->_section as $s) {
|
foreach($this->_section as $s) {
|
||||||
|
if (is_string($s)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$module = explode('_', $s->active_module, 2);
|
$module = explode('_', $s->active_module, 2);
|
||||||
if (count($module) < 2) {
|
if (count($module) < 2) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -106,7 +109,6 @@ class View_Top extends View_Composite {
|
||||||
|
|
||||||
$script .= $value . ".execute('" . $s->module_action . "', " . json_encode($init) .");\n";
|
$script .= $value . ".execute('" . $s->module_action . "', " . json_encode($init) .");\n";
|
||||||
$startup[] = $script;
|
$startup[] = $script;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// View_Top => View_Base + View_List + View_Template
|
|
||||||
class View_View
|
class View_View
|
||||||
{
|
{
|
||||||
protected $_section = array(); // Вложенные шаблоны
|
protected $_section = array(); // Вложенные шаблоны
|
||||||
|
|
@ -31,11 +30,13 @@ class View_View
|
||||||
* @param string $section переменная шаблона
|
* @param string $section переменная шаблона
|
||||||
* @param CompositeView $view вложенный шаблон
|
* @param CompositeView $view вложенный шаблон
|
||||||
*/
|
*/
|
||||||
public function setView($section, View_View $view)
|
public function setView($section, /*View_View|string*/ $view)
|
||||||
{
|
{
|
||||||
$this->_section [$section] = $view;
|
$this->_section [$section] = $view;
|
||||||
|
if (is_object($view)) {
|
||||||
$view->parent_view = $this;
|
$view->parent_view = $this;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function assignValues($values)
|
public function assignValues($values)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue