Symfony 3.4 Use view inside my bundle

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.

Leave a Comment