php smarty缓存问题,高分! 50
我修改了一篇文章,怎么手动更新该文章缓存啊?执行$smarty->clear_cache('show.tpl',$_GET['id'])怎么不行啊?文章还是显示修改前的内...
我修改了一篇文章,怎么手动更新该文章缓存啊?执行$smarty->clear_cache('show.tpl',$_GET['id'])怎么不行啊?文章还是显示修改前的内容。
我的smarty配置如下:
$smarty->template_dir = "smarty/templates/";
$smarty->compile_check = true;
$smarty->compile_id = $_GET['id'];
$smarty->compile_dir = "smarty/templates_c/";
$smarty->config_dir = "smarty/config/";
$smarty->cache_dir = "smarty/cache/";
$smarty->left_delimiter = "{<";
$smarty->right_delimiter = ">}";
$smarty->caching = 2;
$smarty->cache_lifetime = 3600;
$smarty->debugging = false;
显示模板时用了
$smarty->display("show.tpl",$data['0']->id);
$data['0']->id为文章的id
后台程序是
<?
require_once("../smarty/configs/config.php");
if($_GET['action'] == "clear" && $_GET['id'] !=""){
$smarty->clear_cache('show.tpl',$_GET['id']);
echo "<script>alert('清除成功');</script>";
}
?>
<a href="?action=clear&&id=<?echo $data['0']->id;?>">清除缓存</a>
用$smarty->clear_all_cache();也不行 展开
我的smarty配置如下:
$smarty->template_dir = "smarty/templates/";
$smarty->compile_check = true;
$smarty->compile_id = $_GET['id'];
$smarty->compile_dir = "smarty/templates_c/";
$smarty->config_dir = "smarty/config/";
$smarty->cache_dir = "smarty/cache/";
$smarty->left_delimiter = "{<";
$smarty->right_delimiter = ">}";
$smarty->caching = 2;
$smarty->cache_lifetime = 3600;
$smarty->debugging = false;
显示模板时用了
$smarty->display("show.tpl",$data['0']->id);
$data['0']->id为文章的id
后台程序是
<?
require_once("../smarty/configs/config.php");
if($_GET['action'] == "clear" && $_GET['id'] !=""){
$smarty->clear_cache('show.tpl',$_GET['id']);
echo "<script>alert('清除成功');</script>";
}
?>
<a href="?action=clear&&id=<?echo $data['0']->id;?>">清除缓存</a>
用$smarty->clear_all_cache();也不行 展开
展开全部
楼上
觉得你这个比较有意思
$smarty->left_delimiter = "{<";
$smarty->right_delimiter = ">}";
觉得你这个比较有意思
$smarty->left_delimiter = "{<";
$smarty->right_delimiter = ">}";
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询