板㑄:Qif
句常𠳨
板㑄尼用抵𫜵之?
伴固体使用板㑄尼抵扒着構築 if...else 𧵑仍言語立程實。板㑄尼㐌得𠊝替憑函句法 #if:。
碎使用伮如勢𱜢?
{{qif
|test=價值抵㧗
|then=文本抵顯示裊結果空𥧪(固体包𠁟價值抵㧗)
|else=文本抵顯示裊伮𥧪
}}
- 空扒𫃚定參數
else。 - 空定𤑟結果裊參數
test吧/或then空得定𫥨。 - 拱空定𤑟結果裊參數恪貝
test、then、吧else得定𫥨。 - 板㑄尼空活動貝詞銙
subst:。
譬喻
| 碼源 | 結果 |
|---|---|
{{qif
|test={{boolne|foo|bar}}
|then=true
|else=false
}}
|
true |
{{qif
|test={{booleq|foo|bar}}
|then=true
|else=false
}}
|
true |
{{qif
|test=
|then=bar
}}
|
|
{{qif
|test=foo
|then=bar
}}
|
bar |
䀡添
- {{spif}}
- {{if}}
- {{if defined}}
- {{switch}}