Reputation: 1836
I want to do following
{% set checkicon = '<a id="{{ participant.id }}">' %}
<td>{{ checkicon | raw }}</td>
It doesnt word because twig variable in twig variable-definition is not possible. i heard about doing somthing like this
<td>{{ checkicon | replace({ '{{ participant.id }}': participant.id }) }}</td>
but now i have the problem that i want to add the raw-filter too. is it possible to add two filters to a twig variable? didnt found anything about that on net.
ty in advance!
Upvotes: 0
Views: 144
Reputation: 7808
Try this. The ~
token is a concatenation for strings.
{% set checkicon = '<a id="' ~ participant.id ~ '">' %}
Upvotes: 2