freemarker if else 判断使用与其他标签含义

一:[#if list?? && (list?size gt 0)] 内容   [/#if]//list不为空并且list的size大于0

二:[#if list?? && list?size gt 0 ]   内容 [#elseif  list?? && list?size == 0 ]  内容[/#if] //elseif部分判断

三:[#list list as current]  //相当于for循环current为当前list中的对象

四:[#if hlist?? && hlist?size gt 0]
             [#list hlist as h]${h.name}[#if h_has_next]内容[/#if][/#list]</span>//判断list还有下一个
       [/#if]

五:[#include 'inc/inc_column_head.ftl' /]  //相当于html中的include

六:<#if str == "1"> </#if>  //等于判断

<#if str !== "1"> </#if>   //非等于判断

七:[#list list as current]  ${current_index}  </#list>  list遍历中的下标序号

发布了55 篇原创文章 · 获赞 18 · 访问量 13万+

猜你喜欢

转载自blog.csdn.net/world_the_begin/article/details/93598664