Pregunta

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..

¿Fue útil?

Solución

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

{% if (formDataValues.id) or (formDataValues.ID) %}
....
{% endif %}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top