Get Smarty

Donate

Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

Grupos de Cache

Você pode fazer agrupamentos mais elaborados configurando grupos de cache_id. Isso é realizado pela separação de cada sub-grupo com uma barra vertical "|" no valor do cache_id. Você pode ter muitos sub-grupos com você desejar.

Example 14.9. Grupos de cache_id

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

Notas Técnicas

O agrupamento de cache id NÃO use o path do template como alguma parte do cache_id. Por exemplo, se você tem display('themes/blue/index.tpl'), você não pode limpar o cache para tudo que estiver sob o diretório "themes/blue". Se você quiser fazer isso, você deve agrupá-los no cache_id, como display('themes/blue/index.tpl','themes|blue'); Então você pode limpar os caches para o tema azul com with clear_cache(null,'themes|blue');

Comments
No comments for this page.

Advertisement

Sponsors [info]

Sponsors