is_cached

PHP Smarty

Smarty - the compiling PHP template engine
Prev 来源:PHP中文社区 Chapter 13. Methods Next

is_cached
是否已被缓存

$smarty->caching = true;

if(!$smarty->is_cached("index.tpl")) {
// do database calls, assign vars here
// 调用数据库,并对变量进行赋值
}

$smarty->display("index.tpl");
$smarty->caching = true;

if(!$smarty->is_cached("index.tpl","FrontPage")) {
// do database calls, assign vars here
}

$smarty->display("index.tpl","FrontPage");

Prev 来源:PHP中文社区 Home Next
get_template_vars
取得模板变量的值
Up load_filter
加载过滤器