IF a == true OR b == true 陈述 [英] IF a == true OR b == true statement

查看:18
本文介绍了IF a == true OR b == true 陈述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到让 TWIG 解释以下条件语句的方法:

I can't find a way to have TWIG interpret the following conditional statement:

{% if a == true or b == true %}
do stuff
{% endif %}

是我遗漏了什么还是不可能?

Am I missing something or it's not possible?

推荐答案

检查这个 Twig 参考.

你可以做到这么简单:

{% if (a or b) %}
    ...
{% endif %}

这篇关于IF a == true OR b == true 陈述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆