【发布时间】:2014-04-09 10:16:57
【问题描述】:
我需要在twig中设置一些条件,所以我有这个:
{% if app.session.get('campaignVersion') is not null and is not '4.4d'}
...
{% elseif app.session.get('campaignVersion') is null or '4.4d' %}
...
{% endif %}
但是我在语法和逻辑上有错误,也许它必须有一个标准运算符,例如!=,我做错了什么?谢谢帮助。
【问题讨论】:
-
顺便说一句,我会在控制器中进行这样的计算,在这种情况下为您留下一个更可重用的模板。
标签: php templates twig conditional-statements