if variable twig on symfony

symfony, twig

Solution

You can't nest delimeters like that.

Correct syntax would be:

{% if liste == "Call Drop" %}

Problem

I would like to do a test on the values ​​selected by the select tag multiple. I tried with this code, but I get this error: A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "punctuation" of value "{" in AdminBlogBundle:GestionGraph:graphkpi1.html.twig at line 575 ``` {% for liste in Col1_Array %} {% if {{liste}} is "Call Drop" %} <div id="chartdiv" style="width: 100%; height: 400px;"></div> {% else %} <div id="chartdiv1" style="width: 100%; height: 400px;"></div> {% endif %} {% endfor %} ``` Who can help me please?

Original source