Including a non-twig file from twig

前端 未结 4 1815
粉色の甜心
粉色の甜心 2021-02-14 19:51

I need to include the contents of a file (inside my resources folder) inside a Twig template.

I have tried this with no luck:

{% include \'public/directo         


        
4条回答
  •  佛祖请我去吃肉
    2021-02-14 20:47

    New in version 1.15: The source function was added in Twig 1.15. The source function returns the content of a template without rendering it

    http://twig.sensiolabs.org/doc/functions/source.html

提交回复
热议问题