当前位置: 首页>>代码示例>>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;未经允许,请勿转载。