freemarker中兑现自定义标签(包含处理参数以及循环变量)(2.3.11版本以后的方式)
freemarker中实现自定义标签(包含处理参数以及循环变量)(2.3.11版本以后的方式)复制内容到剪贴板#assign?
freemarker中实现自定义标签(包含处理参数以及循环变量)(2.3.11版本以后的方式)
复制内容到剪贴板
- <#assign?x?=?1>????
- 一个参数: ??<@repeat?count=4>??
- ??Test?${x} ????<#assign?xx?=?x?+?1>??
- </@repeat>????
- 二个参数: ??<@repeat?count=3?hr=true>??
- ??Test ??</@repeat>??
- ??循环变量: ??
- <@repeat?count=3;?cnt>????${cnt}.?Test ??
- </@repeat>????
输出结果:
一个参数:
? Test 1
? Test 2
? Test 3
? Test 4
二个参数:
? Test
<hr>? Test
<hr>? Test
循环变量:
? 1. Test
? 2. Test
? 3. Test