当前位置: 首页>>代码示例>>PHP>>正文


PHP MyView::renderCache方法代码示例

本文整理汇总了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;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:23,代码来源:controller.php

示例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;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:46,代码来源:dispatcher.php


注:本文中的MyView::renderCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。