thelia/smarty-cache-module

安装: 101

依赖: 0

建议者: 0

安全: 0

星星: 0

关注者: 7

分支: 1

开放问题: 0

类型:thelia-module

1.0.0 2015-11-28 19:58 UTC

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 : 根据角色特定缓存(无、客户、管理员),可能的值:(默认:

您可以添加您需要的任何参数。这些参数将被用来生成一个唯一的键。