How to display string that contains HTML in twig template?

前端 未结 4 619
刺人心
刺人心 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 20:33

    Use raw keyword, http://twig.sensiolabs.org/doc/api.html#escaper-extension

    {{ word | raw }}
    

提交回复
热议问题