How can I display a string that contains HTML tags in twig template?
My PHP variable contains this html and text:
$word = \' a word
if you don't need variable, you can define text in
translations/messages.en.yaml :
CiteExampleHtmlCode: " my static text "
then use it with twig:
templates/about/index.html.twig
… {{ 'CiteExampleHtmlCode' }}
or if you need multilangages like me:
… {{ 'CiteExampleHtmlCode' | trans }}
Let's have a look of https://symfony.com/doc/current/translation.html for more information about translations use.