Fosuserbundle: Override default templates in Symfony 4

Created on 13 Apr 2018  路  4Comments  路  Source: FriendsOfSymfony/FOSUserBundle

Hi,

how to override default templates in symfony 4?
Documentation has not changed:

https://symfony.com/doc/current/bundles/FOSUserBundle/overriding_templates.html

a) Define New Template In app/Resources

The easiest way to override a bundle's template is to simply place a new one in your app/Resources folder. To override the layout template located at Resources/views/layout.html.twig in the FOSUserBundle directory, you would place your new layout template at app/Resources/FOSUserBundle/views/layout.html.twig.

Most helpful comment

@covex-nn: In SF4 the template overrides must be placed in /templates/bundles/{BundleName}.

@kironet: see: https://github.com/FriendsOfSymfony/FOSUserBundle/issues/2779

All 4 comments

@kironet place your templates into src/Resources/FOSUserBundle/views directory

@covex-nn: In SF4 the template overrides must be placed in /templates/bundles/{BundleName}.

@kironet: see: https://github.com/FriendsOfSymfony/FOSUserBundle/issues/2779

Documentation has not changed

However still src/Resources/FOSUserBundle/views should work fine.

Closing as the answer has been given by @Devtronic

Was this page helpful?
0 / 5 - 0 ratings