freemaker if标签

来源:互联网 发布:腾讯网络加速小助手 编辑:程序博客网 时间:2024/05/29 19:56

freemaker标签

                        <#if user.headPath?? && user.headPath!= "">                            <img src="${user.headPath}"                                 style="width:40px;height:40px; border-radius: 20px; float:left; margin:15px 5px 0 10px;"/>                        <#else>                            <img src="${imagePath}/user/header.png"                                 style="width:40px;height:40px; border-radius: 20px; float:left; margin:15px 5px 0 10px;"/>                        </#if>

在html里面写判断

<input type="submit" value="<#if (testModel.id==0)>添加<#else>修改</#if>"/>
   <img src="${userPic!'${imagePath}/user/header.png'}" alt="Logo">
0 0
原创粉丝点击