What is Smarty?
Why use it?
Use Cases and Work Flow
Syntax Comparison
Template Inheritance
Best Practices
Crash Course
You may use the Smarty logo according to the trademark notice.
For sponsorship, advertising, news or other inquiries, contact us at:
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");
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');