Twig: How to print special symbols, such as Copyright, Trademark, etc

前端 未结 2 1364
一个人的身影
一个人的身影 2021-01-24 07:50

I want to use special symbols, but instead all I get printed question mark symbol �

I tried

{% autoescape \'html\' %}
    {{ \'©\'|escape(\'html\') }}           


        
2条回答
  •  别那么骄傲
    2021-01-24 08:24

    Since you want to display a static string and not a variable, you can write the character directly, you don't need to use the {{ }} tag:

    ©
    

    Or by using the HTML entity cited by Miro:

提交回复
热议问题