thelia / smarty-cache-module
1.0.0
2015-11-28 19:58 UTC
Requires
- thelia/installer: ~1.1
This package is auto-updated.
Last update: 2024-09-14 22:16:33 UTC
README
一个简单的模块,用于缓存模板的一些部分。它使用smarty函数。
用法
示例将缓存导航菜单的生成代码。它将根据当前类别、语言和货币生成不同的缓存。缓存将使用60秒后将被删除
{tcache key="navigation" ttl="60" category={category attr="id"}} <div class="navigation"> {loop name="category-navigation" type="category" } .... <!-- other expensive loop --> .... {/loop} </div> {/tcache}
参数
- key : (必需)一个唯一的键
- ttl : (必需)以秒为单位的有效时间
- lang : 根据语言特定缓存,可能的值:开、关(默认:开)
- currency : 根据货币特定缓存,可能的值:开、关(默认:开)
- customer : 根据客户特定缓存,可能的值:开、关(默认:关)
- admin : 根据管理员特定缓存,可能的值:开、关(默认:关)
- role : 根据角色特定缓存(无、客户、管理员),可能的值:开、关(默认:关)
您可以添加您需要的任何参数。这些参数将被用来生成一个唯一的键。