Cache Groups

PHP Smarty

Smarty - the compiling PHP template engine
Prev 来源:PHP中文社区 Chapter 14. Caching Next

Cache Groups [缓存集合]

require('Smarty.class.php');
$smarty = new Smarty;

$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");

Prev 来源:PHP中文社区 Home Next
Multiple Caches Per Page
[每页多个缓存]
Up Controlling Cacheability of Plugins' Output
[高级特征]