Turn off escaping in Symfony 2 / twig

前端 未结 2 606
野的像风
野的像风 2021-01-18 09:00

I\'m creating a form using the form builder in Symfony. I am adding an attribute into the twig file for my checkboxes which contains an ampersand and pound sign, Symfony is

2条回答
  •  执念已碎
    2021-01-18 09:47

    Probably what you need is the raw tag or filter. Also take a look at the autoescape tag.

    To turn autoescaping off globally, set the autoescape option to false in config.yml:

    twig:
        # ...
        autoescape: false
    

提交回复
热议问题