smarty配置文件

来源:互联网 发布:php post 编辑:程序博客网 时间:2024/05/01 22:47
<?php include_once("smarty/Smarty.class.php"); $smarty=new Smarty(); $smarty->caching=true;/*开启缓存*/ $smarty->template_dir="./templates";/*缓存的路径*/ $smarty->compile_dir="./templates_c";/*编译的目录*/ $smarty->cache_dir="./smarty_cache";/*缓存的目录*/ $smarty->left_delimiter="{";/*定义左边的*/ $smarty->right_delimiter='}';/*定义右边的*/ $smarty->cache_lifetime=600;/*缓存的时间*//*$smarty->display('cache.tpl',cache_id);缓存一个页面,生成id$smarty->clear_all_cache();清除所有的缓存$smarty->clear_cache('index.html');清除一个页面$smarty->clear_cache('index.html',cache_id);清除一个固定id的缓存*/?>
0 0