Bouffe
Bouffe

Reputation: 849

Referencing Templates in a Bundle

I saw in the documentation that reference a template have changed between 3.1 & 3.2

3.1 : AcmeBlogBundle:Blog:index.html.twig
3.2 : @AcmeBlog/Blog/index.html.twig

Is the 3.1 way is deprecated ? I didn't find anything about it in the upgrades files

Upvotes: 1

Views: 156

Answers (1)

Krzyc
Krzyc

Reputation: 397

Old method (with colons) is not officialy deprecated (this will probably change according to Christophe Coevoet's tweet), but is not supported by default in Symfony 4.

So second method (with slashes) should be used for new projects.

According to Mike van Riel's blog you can still enable it in Symfony 4 by installing templating component:

$ composer require templating

And modify config/packages/framework.yml

templating:
    engines: ['twig']

More info at When your template cannot be found in Symfony 4.

Upvotes: 1

Related Questions