當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。