Symfony 3.4 Use view inside my bundle

孤者浪人 提交于 2019-11-26 19:08:43

The basic problem appears to be that in S3.4, twig template paths such as 'ListerListerBundle:Default:index.html.twig' are no longer supported.

Replace the path in the controller with:

'@ListerLister/Default/index.html.twig'

And all should be well. If you are ever not sure what the actual namespace prefix is then run:

bin/console debug:twig

to list them.

S3.3 still works fine so this is something that changed in 3.4. Supposed to be using the namespaced format anyways so this is not a big deal.

I did file an issue about this on github: https://github.com/sensiolabs/SensioGeneratorBundle/issues/587

We shall see what the maintainers have to say.

Update: The great and powerful Fabpot himself replied to my issue. If you want to keep using the 'ListerListerBundle:Default:index.html.twig' format for templates then edit your app/config/config.yml file:

# app/config/config.yml
framework:
    templating:
        engines: ['twig']

You should only do this if you have legacy code which still uses the old format. Use twig namespaces for all new code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!