本文整理汇总了PHP中MasterView::setChildView方法的典型用法代码示例。如果您正苦于以下问题:PHP MasterView::setChildView方法的具体用法?PHP MasterView::setChildView怎么用?PHP MasterView::setChildView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MasterView
的用法示例。
在下文中一共展示了MasterView::setChildView方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* When rendering, check to see if there's a master view
* to also render.
*
* @return string the render result
*/
public function render($view)
{
$this->setScriptPaths();
if ($view == null) {
echo "NO VIEW SUPPLIED<br/>";
debug_print_backtrace();
exit;
}
$viewToRender = $view;
if ($this->viewFile != '') {
$viewToRender = $this->viewFile;
} else {
$this->setViewFile($view);
}
// first off, render this view.
$result = parent::render($viewToRender);
// If there's a parent view to be rendered, render it, after setting
// this view's content as a variable in that parent view.
if ($this->master != null) {
$this->master->setChildView($this);
$this->master->childViewContent = $result;
$result = $this->master->render('null');
}
return $result;
}