Hey zusammen,
ich benutze Twig als Templatesprache und stehe vor einem Problem.
Ich habe in meinem Array den Key information_id mit dem Wert 10 (string). Nun möchte ich im Twig Template dem Container wenn die information_id gleich 10 ist eine andere Id geben als wenn die information_id gleich 4 ist. Den Wert der information_id erhalte ich als GET-Parameter über die URL.
Nun habe ich mich erkundigt in der TWIG Doku aber irgendwie funktioniert das alles nicht. Ich bekomme immer nur information als ID zurück. Nie information-information obwohl ich über GET 10 erhalte.
Mein TWIG Code:
Code
{% if information_id == '10' %}
{% set id = 'information-information' %}
{% else %}
{% set id = 'information' %}
{% endif %}
<div id="{{ id }}" class="container">
</div>
Was mache ich falsch?
Grüße,
Stef