public function recursiveRender()
{
if ($this->hook('pre-recursive-render')) {
return;
}
$cutting_here = false;
$cutting_output = '';
$this->initTemplateTags();
if (isset($_GET['cut_object']) && ($_GET['cut_object'] == $this->name || $_GET['cut_object'] == $this->short_name)) {
// If we are cutting here, render childs and then we are done
unset($_GET['cut_object']);
$cutting_here = true;
$this->addHook('output', function ($self, $output) use(&$cutting_output) {
$cutting_output .= $output;
});
}
if ($this->model && is_object($this->model) && $this->model->loaded()) {
$this->modelRender();
}
foreach ($this->elements as $key => $obj) {
if ($obj instanceof self) {
$obj->recursiveRender();
$obj->moveJStoParent();
}
}
if (!isset($_GET['cut_object'])) {
if (isset($_GET['cut_region'])) {
$this->region_render();
} else {
$this->render();
}
}
if ($cutting_here) {
//$result=$this->owner->template->cloneRegion($this->spot)->render();
if (isset($this->app->jquery)) {
/** @type App_Web $this->app */
$this->app->jquery->getJS($this);
}
throw new Exception_StopRender($cutting_output);
}
// if template wasn't cut, we move all JS chains to parent
}