當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Smarty::is_cached方法代碼示例

本文整理匯總了PHP中Smarty::is_cached方法的典型用法代碼示例。如果您正苦於以下問題:PHP Smarty::is_cached方法的具體用法?PHP Smarty::is_cached怎麽用?PHP Smarty::is_cached使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Smarty的用法示例。


在下文中一共展示了Smarty::is_cached方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: is_cached

 /**
  * Checks to see if the current items is cached.
  * @param string $template The tempalte to check
  * @return boolean True if the template was cached
  */
 public function is_cached($template, $cache_id = null)
 {
     if (is_null($cache_id)) {
         return $this->_smarty->is_cached($template);
     } else {
         return $this->_smarty->is_cached($template, $cache_id);
     }
 }
開發者ID:RobertGresdal,項目名稱:widget-testcase-framework,代碼行數:13,代碼來源:Zend_View_Smarty.class.php

示例2: display

 /**
  * キャッシュテンプレート表示処理
  *
  * @param <type> $name
  */
 public function display($name)
 {
     // キャッシュされていれば、それを表示する
     if ($this->_smarty->is_cached($name, $this->_cache_id)) {
         $this->_smarty->display($name, $this->_cache_id);
         exit;
     }
 }
開發者ID:nakajijapan,項目名稱:Zend_Framework_View_Smarty,代碼行數:13,代碼來源:Smarty.php

示例3:

 /**
  * test to see if valid cache exists for this template
  *
  * @param string $tpl_file name of template file
  * @param string $cache_id
  * @param string $compile_id
  * @return string|false results of {@link _read_cache_file()}
  */
 function is_cached($tpl_file, $cache_id = null, $compile_id = null)
 {
     if (!$this->caching) {
         return false;
     }
     if (!isset($compile_id)) {
         $compile_id = $this->language->getCurrentLanguage() . '-' . $this->compile_id;
         $cache_id = $compile_id;
     }
     return parent::is_cached($tpl_file, $cache_id, $compile_id);
 }
開發者ID:php2code,項目名稱:School,代碼行數:19,代碼來源:SmartyML.php

示例4: is_cached

 /**
  * 重載Smarty中的is_cached方法
  * @param	string	$tpl_file	模板的位置
  * @param	mixed	$cache_id	緩存的ID
  */
 public function is_cached($tpl_file = null, $cache_id = null, $compile_id = null)
 {
     if (is_null($tpl_file)) {
         $tpl_file = $_GET['m'] . '/' . $_GET['a'] . '.' . TPLPREFIX;
     } else {
         if (strstr($tpl_file, '/')) {
             $tpl_file = $tpl_file . TPLPREFIX;
         } else {
             $tpl_file = $_GET['m'] . '/' . $tpl_file . '.' . TPLPREFIX;
         }
     }
     return parent::is_cached($tpl_file, $cache_id, $compile_id);
 }
開發者ID:BigMaster,項目名稱:Huphp,代碼行數:18,代碼來源:mytpl.class.php

示例5:

 function is_cached($tpl_file = null, $cache_id = null, $compile_id = null)
 {
     if (is_null($tpl_file)) {
         $tpl_file = "{$_GET["m"]}/{$_GET["a"]}." . TPLPREFIX;
     } else {
         if (strstr($tpl_file, "/")) {
             $tpl_file = $tpl_file . "." . TPLPREFIX;
         } else {
             $tpl_file = $_GET["m"] . "/" . $tpl_file . "." . TPLPREFIX;
         }
     }
     return parent::is_cached($tpl_file, $cache_id, $compile_id);
 }
開發者ID:mikelkl,項目名稱:online_exam,代碼行數:13,代碼來源:mytpl.class.php

示例6: is_cached

 /**
  * Finds out if a template is already cached.
  *
  * This returns true if there is a valid cache for this template.
  *
  * @param string $template   The name of the template.
  * @param string $cache_id   The cache ID (optional).
  * @param string $compile_id The compile ID (optional).
  *
  * @return boolean
  */
 public function is_cached($template, $cache_id = null, $compile_id = null)
 {
     if (is_null($cache_id)) {
         $cache_id = $this->cache_id;
     }
     if (is_null($compile_id)) {
         $compile_id = $this->compile_id;
     }
     return parent::is_cached($template, $cache_id, $compile_id);
 }
開發者ID:Silwereth,項目名稱:core,代碼行數:21,代碼來源:View.php

示例7:

 /**
  * finds out if a template is already cached
  *
  * This returns true if there is a valid cache for this template.
  * Right now, we are just passing it to the original Smarty function.
  * We might introduce a function to decide if the cache is in need
  * to be refreshed...
  *
  * @param   string   $template    the name of the template
  * @param   string   $cache_id    (optional) the cache ID
  * @return  boolean
  */
 function is_cached($template, $cache_id = null, $compile_id = null)
 {
     // insert the condition to check the cache here!
     // if (functioncheckdb($this -> module)) {
     //        return parent :: clear_cache($template, $this -> cache_id);
     //}
     $this->_setup_template($template);
     if ($cache_id) {
         $cache_id = $this->module . '|' . $cache_id;
     } else {
         $cache_id = $this->module . '|' . $this->cache_id;
     }
     if (!isset($compile_id)) {
         $compile_id = $this->compile_id;
     }
     return parent::is_cached($template, $cache_id, $compile_id);
 }
開發者ID:orbitroom,項目名稱:EVE-Online-POS-Tracker,代碼行數:29,代碼來源:eveRender.class.php

示例8: isCached

 /**
  * Use Smarty caching
  *
  * The last two methods were created to simply integrate the Smarty caching mechanism in the View class. With the first one you can check for cached template and with the second one you can set the caching on or of.
  *
  * @param string $template
  * @return bool
  */
 public function isCached($template)
 {
     return $this->_smarty->is_cached($template);
 }
開發者ID:iLoiLohas,項目名稱:pinchshopper,代碼行數:12,代碼來源:Smarty.php

示例9: Smarty

 function print_summary($type = 'full')
 {
     global $current_user, $globals, $the_template, $smarty;
     include_once './Smarty.class.php';
     $smarty = new Smarty();
     $smarty->compile_check = false;
     // enable caching at your own risk. this code is still experimental
     //$smarty->cache = true;
     $smarty->cache_lifetime = 120;
     $smarty->cache_dir = "templates_c/";
     $smarty->compile_dir = "templates_c/";
     $smarty->template_dir = "templates/";
     $smarty->config_dir = "";
     if (!$smarty->is_cached($the_template . '/link_summary.tpl', 'story' . $this->id . "|" . $current_user->user_id . "|" . $type)) {
         if (phpnum() == 4) {
             $smarty->force_compile = true;
         }
         $smarty = $this->fill_smarty($smarty, $type);
         $smarty->assign('use_title_as_link', use_title_as_link);
         $smarty->assign('open_in_new_window', open_in_new_window);
         $smarty->assign('use_thumbnails', use_thumbnails);
         $smarty->assign('the_template', The_Template);
         // this is soooo ugly. we'll fix this for beta 9
         $main_smarty = $smarty;
         include mnminclude . 'extra_fields_smarty.php';
         $smarty = $main_smarty;
     }
     $smarty->display($the_template . '/link_summary.tpl', 'story' . $this->id . "|" . $current_user->user_id . "|" . $type);
 }
開發者ID:holsinger,項目名稱:openfloor,代碼行數:29,代碼來源:link.php

示例10:

 function is_cached($tpl_file = null, $cache_id = null, $compile_id = null)
 {
     return parent::is_cached($this->templateName, $this->cacheId);
 }
開發者ID:hostinger,項目名稱:revive-adserver,代碼行數:4,代碼來源:Template.php

示例11: elseif

 function is_cached($_smarty_tpl_file, $_smarty_cache_id = null, $_smarty_compile_id = null)
 {
     global $prefs, $style_base, $tikidomain;
     if (isset($prefs['style']) && isset($style_base)) {
         if ($tikidomain and file_exists("templates/{$tikidomain}/styles/{$style_base}/{$_smarty_tpl_file}")) {
             $_smarty_tpl_file = "{$tikidomain}/styles/{$style_base}/{$_smarty_tpl_file}";
         } elseif ($tikidomain and file_exists("templates/{$tikidomain}/{$_smarty_tpl_file}")) {
             $_smarty_tpl_file = "{$tikidomain}/{$_smarty_tpl_file}";
         } elseif (file_exists("templates/styles/{$style_base}/{$_smarty_tpl_file}")) {
             $_smarty_tpl_file = "styles/{$style_base}/{$_smarty_tpl_file}";
         }
     }
     $_smarty_cache_id = $prefs['language'] . $_smarty_cache_id;
     $_smarty_compile_id = $prefs['language'] . $_smarty_compile_id;
     return parent::is_cached($_smarty_tpl_file, $_smarty_cache_id, $_smarty_compile_id);
 }
開發者ID:Kraiany,項目名稱:kraiany_site_docker,代碼行數:16,代碼來源:setup_smarty.php

示例12: cached

 /**
  * Returns whever current loaded template is cached or not
  * @return	bool	true if cached
  */
 public function cached()
 {
     return parent::is_cached($this->data['template'] . ".tpl", $this->data['cache_version'], BF::gc('locale_enabled') ? BF::gl()->locale : null);
 }
開發者ID:laiello,項目名稱:phpbf,代碼行數:8,代碼來源:BF_output_template.php

示例13:

// MODEL
//----------------------------------------------------------------------------------------------------------------------------------//
include_once "./common/include.display.members.php";
include_once "./common/include.display.committees.php";
include_once "./common/include.display.achievements.php";
include_once "./common/include.display.todaysattendance.php";
include_once "./common/include.display.recentachievements.php";
include_once "./common/include.display.perfectattendance.php";
include_once "./common/include.display.attendance.php";
include_once "./common/include.display.charts.php";
//----------------------------------------------------------------------------------------------------------------------------------//
// CONTROLLER
//----------------------------------------------------------------------------------------------------------------------------------//
if (isset($_GET['charts'])) {
    $smarty->caching = 1;
    if (!$smarty->is_cached('reportCharts.tpl')) {
        $smarty->assign("all_members", report_chart_major_pie_chart());
        $smarty->assign("committee_involvement", report_chart_committee_pie_chart());
        $smarty->assign("members_first_count", report_chart_major_member_count(10));
        $smarty->assign("members_first", report_chart_member_breakdown(10));
        $smarty->assign("members_second_count", report_chart_major_member_count(11));
        $smarty->assign("members_second", report_chart_member_breakdown(11));
        $smarty->assign("members_third_count", report_chart_major_member_count(12));
        $smarty->assign("members_third", report_chart_member_breakdown(12));
        $smarty->assign("members_forth_count", report_chart_major_member_count(13));
        $smarty->assign("members_forth", report_chart_member_breakdown(13));
        $smarty->assign("members_fifth_count", report_chart_major_member_count(14));
        $smarty->assign("members_fifth", report_chart_member_breakdown(14));
        $smarty->assign("members_phd_count", report_chart_major_member_count(15));
        $smarty->assign("members_phd", report_chart_member_breakdown(15));
        $smarty->assign("members_mal_count", report_chart_major_member_count(19));
開發者ID:remlex,項目名稱:student-council-attendance,代碼行數:31,代碼來源:display.php

示例14: is_cached

 /**
  * Переопределение одноименного метода Smarty
  * для пользовательских шаблонов созданных в теме дизайна.
  *
  * @param string $tpl_file name of template file
  * @param string $cache_id
  * @param string $compile_id
  * @return string|false results of {@link _read_cache_file()}
  */
 function is_cached($tpl_file, $cache_id = null, $compile_id = null)
 {
     return Smarty::is_cached($this->_redefine_template($tpl_file), $cache_id, $compile_id);
 }
開發者ID:laiello,項目名稱:avecms,代碼行數:13,代碼來源:class.template.php

示例15:

 function is_cached()
 {
     return parent::is_cached($this->templateName, $this->cacheId);
 }
開發者ID:villos,項目名稱:tree_admin,代碼行數:4,代碼來源:Template.php


注:本文中的Smarty::is_cached方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。