You can do more elaborate grouping by setting up cache_id groups. This is accomplished by separating each sub-group with a vertical bar "|" in the cache_id value. You can have as many sub-groups as you like.
Example 14-9. cache_id groups
代码如下 | 复制代码 |
require('Smarty.class.php'); $smarty->caching = true; |
// clear all caches with "sports|basketball" as the first two cache_id groups
代码如下 | 复制代码 |
$smarty->clear_cache(null,"sports|basketball"); |
// clear all caches with "sports" as the first cache_id group. This would
// include "sports|basketball", or "sports|(anything)|(anything)|(anything)|..."
代码如下 | 复制代码 |
$smarty->clear_cache(null,"sports"); $smarty->display('index.tpl',"sports|basketball"); |
在不知如何清除 Smarty 中带 id 的缓存时,找到了手册中上面说明,可惜英文太差,不知所云。
在 csdn 中找到网友帖子,看完后恍然大悟。
就是在缓存页面的时候像这样:
代码如下 | 复制代码 |
$smarty-> display( 'basic.tpl ', "groupxxx| ".$cache_id); |
然后要清这个groupxxx组下的所有缓存,则像这样:
代码如下 | 复制代码 |
$smarty-> clear_cache(null, "groupxxx "); |
摩尔庄园 安卓官方版v2.9.24091002S
摩尔庄园很多小伙伴一定都在小时候玩过,但随着我们年龄的增长淡
梦幻庄园最新版 官方正版v1.0.0
梦幻庄园是一款非常好玩的模拟经营类游戏,玩家在游戏中有一个属
合并梦幻岛免内购版 v2.1.0
合并梦幻岛无限内购版是游戏的破解版本,在该版本中为玩家解锁了
无悔华夏魅族版 2025最新版v3.5.194
无悔华夏魅族版是一款超级好用的模拟经营游戏。在这里玩家们需要
月影别墅官方安装包2025版 安卓版v2.3.24
月影别墅官方安装包2025版是一款匠心独具的乙女向剧情游戏,