Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
If statement 如果条件为空,则使用Freemarker_If Statement_Conditional Statements_Freemarker - Fatal编程技术网

If statement 如果条件为空,则使用Freemarker

If statement 如果条件为空,则使用Freemarker,if-statement,conditional-statements,freemarker,If Statement,Conditional Statements,Freemarker,我只想要一份没有截止日期的学校名单。在SQL中,我总是使用条件为null,它在Freemarker中是如何工作的 <#list mergevelden.adres_instantie_344.betrokken_instanties.betrokken_instantie as scholen><br> ***<#if scholen.tm="null">*** ${scholen.instantie.volledige_naam} ${scholen.ins

我只想要一份没有截止日期的学校名单。在SQL中,我总是使用条件
为null
,它在Freemarker中是如何工作的

<#list mergevelden.adres_instantie_344.betrokken_instanties.betrokken_instantie as scholen><br>
***<#if scholen.tm="null">***
${scholen.instantie.volledige_naam}
${scholen.instantie.adressen.adres.straat} ${scholen.instantie.adressen.adres.huisnummer}
${scholen.instantie.adressen.adres.postcode}  ${scholen.instantie.adressen.adres.woonplaats?upper_case}<br>
</#if>
</#list>

****** ${scholen.instantie.volledige_naam} ${scholen.instantie.adressen.adres.straat}${scholen.instantie.adressen.adres.huissummer} ${scholen.instantie.adressen.adres.postcode}${scholen.instantie.adressen.adres.woonplaats?大写}

scholen.tm???
告诉您是否存在
scholen.tm
(非
null
)。这与您的要求相反,但您可以将其转换为
!scholen.tm???
。但是最好使用
#如果
分支用于存在
scholen.tm
的情况,那么
#else
分支用于不存在的情况

还请注意,在许多情况下,您可以避免使用
#if
。比如,如果您只需要一个默认值,那么您可以执行类似于
foo.bar!'的操作默认的if栏为空“

可能重复的