1.${…}:
FTL 标签一般以符号#开头
注释:<#--和-->
${user} <#if user=='Big joe'>,wwwww</#if> 当 user=big joe 时。里面的东西才输出
2,<#if animals.python.price < animals.elephant.price>
Pythons are cheaper than elephants today.
<#else>
Pythons are not cheaper than elephants today.
</#if>
3.列表来遍历集合 animals
<#list animals as being>
<tr><td>${being.name}<td>${being.price} Euros
</#list>
输出: <tr><td>mouse<td>50 Euros
<tr><td>elephant<td>5000 Euros
<tr><td>python<td>4999 Euros
<#list ["winter", "spring", "summer", "autumn"]
${x}
</#list>
4.<#include "/copyright_footer.html">
5.遍历 list
<#list animals as being>
<tr>
<td>
<#if being.size == "large"><font size="+1"></#if>
${being.name}
<#if being.size == "large"></font></#if>
<td>${being.price} Euros
</#list>
6.指定一个默认值来避免变量丢失这种情况 一个不存在的
变量和一个是 null 的变量
评论0
最新资源