是否可以在 freemarker 中使用 and(&&) 或者是否必须使用嵌套的 if?
<#if object?exists >
</#if>
最佳答案
您可以在 Free Maker 中使用 && 作为逻辑运算符。请参阅Logical operations
例如
<#if x < 12 && color = "green">
We have less than 12 things, and they are green.
</#if>
<#if !hot> <#-- here hot must be a boolean -->
It's not hot.
</#if>
关于freemarker - 并且在 freemarker 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12929312/