本文整理汇总了PHP中Template_Controller::_render方法的典型用法代码示例。如果您正苦于以下问题:PHP Template_Controller::_render方法的具体用法?PHP Template_Controller::_render怎么用?PHP Template_Controller::_render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template_Controller
的用法示例。
在下文中一共展示了Template_Controller::_render方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _render
/**
* Overriding the render method gives us a single point to check that this page
* is authorised.
*/
public function _render()
{
if (!$this->page_authorised()) {
$this->access_denied('page');
}
parent::_render();
}
示例2: _render
/**
* This will do all the actions required before rendering the template.
* Setting up the notifications and navigatiosn, working out what to return
* based on what type of request it is etc.
*/
public function _render()
{
if (request::is_ajax()) {
// if the view has been set, then only ever return the view html
// if this view is set please make sure there are no redirect under it.
if (isset($this->ajax['view'])) {
header('content-type: text/html');
echo $this->ajax['view'];
} else {
if ($this->notification->count()) {
$this->ajax['notifications'] = $this->notification->get();
}
header('content-type: application/json');
echo json_encode($this->ajax);
}
} else {
if ($this->notification->count()) {
$this->template->notifications = View::factory('templates/notification', array('notifications' => $this->notification->get()));
}
$this->template->breadcrumbs = $this->breadcrumbs->get();
$this->template->navigation = $this->navigation->display();
$this->template->css_classes = $this->css_classes;
parent::_render();
}
}
示例3: _render
public function _render()
{
if ($this->auto_render) {
// Add styles
$this->template->styles = array('userguide/media/css/print.css' => 'print', 'userguide/media/css/screen.css' => 'screen', 'userguide/media/css/kodoc.css' => 'screen', 'userguide/media/css/topline.css' => 'screen', 'userguide/media/css/shCore.css' => 'screen', 'userguide/media/css/shThemeDefault.css' => 'screen');
// Add scripts
$this->template->scripts = array('userguide/media/js/jquery-1.3.2.min.js', 'userguide/media/js/jquery.coda-slider-2.0.js', 'userguide/media/js/jquery.easing.1.3.js', 'userguide/media/js/kodoc.js', 'userguide/media/js/shCore.js', 'userguide/media/js/shBrushPhp.js');
}
return parent::_render();
}