2012-10-17 20 views
6

Czy można mieć i (& &) w freemarker lub czy muszę użyć zagnieżdżonego, jeśli?W freemarker

<#if object?exists > 


</#if> 
+3

Czy to próbował? – Dirk

Odpowiedz

24

Można użyć & & jako operator logiczny w wolnej kawy. Zobacz Logical operations

Na przykład

<#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>