我有一个简单的Leaf模板,我想在其中显示Hello World。
#if(false) {
<title> All hail Apodron.</title>
} #else {
<title> Hello World </title>
}
该页面没有标题,并显示为:
#else {Helloward}
但是,如果我将其更改为:
#if(true) {
<title> All hail Apodron.</title>
} #else {
<title> Hello World </title>
}
然后会显示标题,但页面STILL仍显示为:
#else {Helloward}
我还尝试了各种语法,例如:
##else {
<title> Hello World </title>
}
和#else() {
<title> Hello World </title>
}
甚至##else() {
<title> Hello World </title>
}
这似乎很基础,我相信我遵循了documentation。
答案 0 :(得分:4)
您的问题似乎是Leaf期望else
,但是正在使用#else
。因此,将模板更改为此可以解决问题:
#if(false) {
<title> All hail Apodron.</title>
} else {
<title> Hello World </title>
}
这里是相关的documentation。