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 "); | |
疯狂医院达什医生中文版(Crazy Hospital)
疯狂医院达什医生最新版是一款医院模拟经营类游戏,逼真的场景画
宝宝庄园官方版
宝宝庄园官方版是一款超级经典好玩的模拟经营类型的手游,这个游
桃源记官方正版
桃源记是一款休闲娱乐类的水墨手绘风格打造的模拟经营手游。玩家
长途巴士模拟器手机版
长途巴士模拟器汉化版是一款十分比真好玩的大巴车模拟驾驶运营类
房东模拟器最新版2024
房东模拟器中文版是一个超级有趣的模拟经营类型的手游,这个游戏