【发布时间】:2013-08-23 15:24:49
【问题描述】:
根据严格的原则进行推理或评估 有效性:“经验是比演绎逻辑更好的指导”。
Mustache 的“部分”使用基于布尔值from the documentation 的块显示形式的条件逻辑:
模板:
Shown.
{{#nothin}}
Never shown!
{{/nothin}}
哈希:
{
"person": true,
}
输出:
Shown.
因此,我很想知道如果我(可能是幼稚/无知)定义下的逻辑出现在其模板中,Mustache 以何种方式被视为“无逻辑”?
【问题讨论】:
-
来自维基百科:
Mustache is described as a "logic-less" system because it lacks any explicit control flow statements, like if and else conditionals or for loops; however, both looping and conditional evaluation can be achieved using section tags processing lists and lambdas. -
这不是矛盾吗?因为如果可以实现条件评估(无论语法如何)它包含逻辑?
标签: php javascript templates logic mustache