syanaputra/silverstripe-extra-template-syntax

为 SilverStripe 模板系统提供额外语法。

1.0 2020-01-22 01:39 UTC

This package is auto-updated.

Last update: 2024-09-22 12:11:55 UTC


README

此模块为 SilverStripe 模板系统添加额外语法。

安装

要安装此模块,只需运行

composer require syanaputra/silverstripe-extra-template-syntax

使用方法

重复

参数

  • 总重复次数 - 需要重复多少次
  • 起始数字 - 起始数字

示例

<% loop $Repeat(3, 5) %>
    {$Index}-  
<% end_loop %>

输出

5-6-7-

重复至

参数

  • 总重复次数 - 需要重复多少次
  • 起始数字 - 起始数字

示例

<% loop $RepeatUntil(5, 3) %>
    {$Index}-  
<% end_loop %>

输出

3-4-5-