本文整理汇总了PHP中MyView::renderCache方法的典型用法代码示例。如果您正苦于以下问题:PHP MyView::renderCache方法的具体用法?PHP MyView::renderCache怎么用?PHP MyView::renderCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyView
的用法示例。
在下文中一共展示了MyView::renderCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cached
function cached($path)
{
if (Configure::read('Cache.enable') && Configure::read('Cache.view')) {
$path = Inflector::slug($path);
$filename = CACHE . 'views' . DS . $path . '.php';
if (!file_exists($filename)) {
$filename = CACHE . 'views' . DS . $path . '_index.php';
}
if (file_exists($filename)) {
if (!class_exists('MyView')) {
App::import('Core', 'View', $this->app);
}
$view = new MyView($this, false);
$view->ajaxRequest = $this->ajaxRequest;
$view->viewSuffix = $this->viewSuffix;
$view->name = $this->name;
// $view->helpers = $this->helpers;
// $view->layout = $this->layout;
return $view->renderCache($filename, S2getMicrotime());
}
}
return false;
}
示例2: cached
/**
* Outputs cached dispatch view cache
*
* @param string $url Requested URL
* @access public
*/
function cached($url)
{
App::import('Component', 'config', $this->app);
$controller = new stdClass();
if (class_exists('ConfigComponent')) {
$Config = new ConfigComponent();
$Config->startup($controller);
}
$User = cmsFramework::getUser();
if ($User->id === 0 && !Configure::read('Cache.disable') && Configure::read('Cache.view') && !defined('MVC_FRAMEWORK_ADMIN')) {
$path = $this->here;
if ($this->here == '/') {
$path = 'home';
}
$path = Inflector::slug($path);
$filename = CACHE . 'views' . DS . $path . '.php';
if (!file_exists($filename)) {
$filename = CACHE . 'views' . DS . $path . '_index.php';
}
if (file_exists($filename)) {
if (!class_exists('MyView')) {
App::import('Core', 'View', $this->app);
}
$controller = null;
$view = new MyView($controller, false);
// Pass the configuration object to the view and set the theme variable for helpers
$view->name = $this->controller;
$view->action = $this->action;
$view->page = Sanitize::getInt($this->params, 'page');
$view->limit = Sanitize::getInt($this->params, 'limit');
$view->Config = $Config;
$view->viewTheme = $Config->template;
$view->xajaxRequest = false;
$view->ajaxRequest = $this->isAjax();
$out = $view->renderCache($filename, S2getMicrotime());
return $out;
}
}
return false;
}