Pergunta

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

Foi útil?

Solução

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

{% if (formDataValues.id) or (formDataValues.ID) %}
....
{% endif %}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top