Tyralcori
Tyralcori

Reputation: 1047

Twig IF ( .. OR .. ) Error

here is a twig error again: (Don't know, why twig punish me..)

Snippet:

{% if (formDataValues.id OR formDataValues.ID) %}
....
{% endif %}

What i wanna do: Check, if one of these values are given in my array.

My Error:

Twig_Error_Syntax [ 0 ]: An opened parenthesis is not properly closed. Unexpected token "name" of value "OR" ("punctuation" expected with value ")") in "MY/PATH/TO/FILE" at line 1

May you have some creative ideas..

Upvotes: 2

Views: 2030

Answers (1)

Ex-iT
Ex-iT

Reputation: 1477

Did you try with a lowercase or and parentheses around the values?

{% if (formDataValues.id) or (formDataValues.ID) %}
....
{% endif %}

Upvotes: 8

Related Questions