我试图服从http://symfony.com/doc/current/book/templating.html#asynchronous-content-with-hinclude-js来设置包含但我没有得到hinclude.html.twig
的内容,而是显示“::hinclude.html.twig
”。
在/app/config/config.yml
我有:
templating:
engines: ['twig']
hinclude_default_template: "::hinclude.html.twig"
hinclude.html.twig
位于/app/Ressources/views/default/hinclude.html.twig
,只不过是:
Loading....
实际内容由hinclude.js正确加载,但不是显示Loading...
,而是只显示配置文件中的模板路径:::hinclude.twig.html
这些配置也不起作用:
hinclude_default_template: ::hinclude.html.twig
hinclude_default_template: "hinclude.html.twig"
hinclude_default_template: hinclude.html.twig
如何使用Twig模板?
谢谢!
答案 0 :(得分:1)
它认为是一个错误的配置...
这不起作用:
hinclude_default_template: "::hinclude.html.twig"
hinclude_default_template: ":Default:hinclude.html.twig"
这确实有效:
hinclude_default_template: ":default:hinclude.html.twig"
您需要使用小写“默认”。