最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Smarty 缓存集合简单讲解
时间:2022-06-25 02:20:37 编辑:袖梨 来源:一聚教程网
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 "); |
相关文章
- Jsp中request的3个基础实践 07-03
- ps利用液化工具把美女眼睛变大 ps人物大眼睛制作教程 07-03
- 穿越火线2025年7月平台福利码一览 07-03
- 必须掌握的28条微信营销技巧 07-03
- 华尔街上链,代币化股票能否续写稳定币的史诗传奇? 07-03
- Dreamweaver怎么设置不可见元素的参数? 07-03