How to display string that contains HTML in twig template?

前端 未结 4 626
刺人心
刺人心 2020-11-30 20:19

How can I display a string that contains HTML tags in twig template?

My PHP variable contains this html and text:

$word = \' a word          


        
4条回答
  •  孤街浪徒
    2020-11-30 20:48

    You can also use:

    {{ word|striptags('')|raw }}
    

    so that only tag will be allowed.

提交回复
热议问题