freemarker变量自加

来源:互联网 发布:妈妈讲故事软件下载 编辑:程序博客网 时间:2024/05/22 08:14
[#assign i = 0]
[#list dateList as item]
[#assign i = i + 1]
<li>
<input type="radio" name="aa" id="time${i}" />
<label for="time${i}">${item}</label>
</li>

[/#list]

这样可以实现自增i了,而freemarker不允许 i++  或者是 i += 1 语法不支持的

0 0