clearCache() — 清除缓存 说明 void clearCache(string template, string cache_id, string compile_id, int expire_time); 模板中如果有使用多个缓存,则可以通过cache_id指定清除相关缓存。 你可以指定第三个参数 $compile_id, 在模板组中清除一组模板,详见 缓存 了解更多。 第四个参数提供了一个最小时间,在这时间到来之前,缓存将会被清除。 Example 14.11. clearCache() <?php // 清除特定模板的缓存 $smarty->clearCache('index.tpl'); // 清除多个缓存的模板中某个特定缓存id的缓存 $smarty->clearCache('index.tpl', 'MY_CACHE_ID'); ?>
<?php // 清除特定模板的缓存 $smarty->clearCache('index.tpl'); // 清除多个缓存的模板中某个特定缓存id的缓存 $smarty->clearCache('index.tpl', 'MY_CACHE_ID'); ?>
4,250
社区成员
4,522
社区内容
加载中
试试用AI创作助手写篇文章吧