freemarker内置函数

  1. 排序
<#assign mylist=[1,2,3,4,5,6,7]>
<#list mylist?sort as item>
    ${item}

  1. 翻转列表reverse
<#assign mylist=[1,2,3,4,5,6,7]>
<#list mylist?reverse as item>
    ${item}

  1. 列表大小
${mylist?size}

你可能感兴趣的:(freemarker内置函数)