代码如下
$smarty = new Smarty;
$smarty->setTemplateDir('../../../website/templates/');
$smarty->setCompileDir('../../../website/templates_c/index/');
$smarty->setCacheDir('../../../website/cache/index/');
$smarty->clearCache('index.html');想删除index.html模板对应的缓存文件,但是一直删除不掉,使用clearAllCache方法倒是可以把index目录下的缓存都删了
$smarty = new Smarty;
$smarty->setTemplateDir('../../../website/templates/');
$smarty->setCompileDir('../../../website/templates_c/index/');
$smarty->setCacheDir('../../../website/cache/index/');
$smarty->clearCache('index.html');想删除index.html模板对应的缓存文件,但是一直删除不掉,使用clearAllCache方法倒是可以把index目录下的缓存都删了
$smarty = new Smarty;
$smarty->setTemplateDir('website/templates/');
$smarty->setCompileDir('website/templates_c/index/');
$smarty->setCacheDir('website/cache/index/');
$smarty->clearCache('index.html');
$smarty->setTemplateDir('website/templates/');
$smarty->setCompileDir('website/templates_c/index/');
$smarty->setCacheDir('website/cache/index/');
$smarty->clearCache('index.html');
可以将参数的路径换成绝对路径试试realpath('../../../website/templates/')