Answers for "twig concatenate string with variable"

PHP
2

twig concat string

{{ 'http://' ~ app.request.host }}

// To add a filter - like 'trans' - in the same tag use
{{ ('http://' ~ app.request.host) | trans }}

// You can also use string interpolation, this does require double quoted strings:
{{ "http://#{app.request.host}" }}
Posted by: Guest on July-08-2021

Code answers related to "twig concatenate string with variable"

Browse Popular Code Answers by Language