本文整理匯總了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);
}
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例10:
function is_cached($tpl_file = null, $cache_id = null, $compile_id = null)
{
return parent::is_cached($this->templateName, $this->cacheId);
}
示例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);
}
示例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);
}
示例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));
示例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);
}
示例15:
function is_cached()
{
return parent::is_cached($this->templateName, $this->cacheId);
}