dotliquid是否支持'不是'作为运营商?

时间:2016-08-03 09:36:25

标签: c# dotliquid

dotliquid支持像和/或。

这样的基本运算符
Basic operators

Operator    Function
==  equals
!=  does not equal
>   greater than
<   less than
>=  greater than or equal to
<=  less than or equal to
or  condition A or condition B
and condition A and condition B

支持&#39;不是&#39;作为运营商?

1 个答案:

答案 0 :(得分:1)

它包含unless作为控制流程,如下所示:

https://shopify.github.io/liquid/tags/control-flow/

这意味着:

if a && b && !c
  # ...
end

转换为:

{% if a and b %}
  {% unless c %}
    ...
  {% endunless %}
{% endif %}