2012-10-17 13 views
6

È possibile avere e (& &) in freemarker o devo usare un nidificato se?E in freemarker

<#if object?exists > 


</#if> 
+3

Avete provato? – Dirk

risposta

24

È possibile utilizzare & & operatore logico e caffè. Vedi Logical operations

Per esempio

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