我有一个问题 - 当它放在子目录中时,我不能在另一个twig文件中包含一个twig文件.例:
我有一个文件AppUserBundle:Dashboard:index.html.twig(symfony路径是src/App/UserBundle/Resorcues/views/Dashboard/index.html.twig其他视图的路径).在那个文件中,我有一个包含Status.html.twig在AppUserBundle:Dashboard:User子目录中的文件.但是当试图包含它时,我收到消息"无法找到模板".
{% include 'AppUserBundle:Dashboard:User:Status.html.twig' %}
Run Code Online (Sandbox Code Playgroud)
当我将Status.html.twig文件移动到AppUserBundle:Dashboard目录并包含它时,一切正常.我可以以某种方式获得这样的文件吗?
AppUserBundle:Dashboard:Subdir:file
Run Code Online (Sandbox Code Playgroud)