Tom Tom - 5 months ago 70
Twig Question

Use twig variable in string

For the language selection I want to show the flag of the current active languages.

I get the language variable by:


Now I want to use the value in the string of the flag url.

<img src="{{ asset('flags/'+app.request.locale+'.png', 'img') }}" />

But what is the correct syntax for this?


You have to use ~ char instead of +.