@@ -5,7 +5,8 @@ How to Override any Part of a Bundle
55====================================
66
77This document is a quick reference for how to override different parts of
8- third-party bundles.
8+ third-party bundles without using :doc: `/bundles/inheritance `, which is
9+ deprecated since Symfony 3.4.
910
1011.. tip ::
1112
@@ -18,10 +19,7 @@ third-party bundles.
1819Templates
1920---------
2021
21- For information on overriding templates, see
22-
23- * :doc: `/templating/overriding `.
24- * :doc: `/bundles/inheritance `
22+ See :doc: `/templating/overriding `.
2523
2624Routing
2725-------
@@ -37,10 +35,10 @@ that routing file into your application, modify it, and import it instead.
3735Controllers
3836-----------
3937
40- Assuming the third-party bundle involved uses non-service controllers (which
41- is almost always the case), you can easily override controllers via bundle
42- inheritance. For more information, see :doc: `/bundles/inheritance `.
4338If the controller is a service, see the next section on how to override it.
39+ Otherwise, define a new route + controller with the same path associated to the
40+ controller you want to override (and make sure that the new route is loaded
41+ before the bundle one).
4442
4543Services & Configuration
4644------------------------
@@ -152,13 +150,4 @@ Translations are not related to bundles, but to domains. That means that you
152150can override the translations from any translation file, as long as it is in
153151:ref: `the correct domain <using-message-domains >`.
154152
155- .. caution ::
156-
157- Translation files are not aware of :doc: `bundle inheritance </bundles/inheritance >`.
158- If you want to override translations from the parent bundle or another bundle,
159- make sure that the bundle containing *your * translations is loaded after any
160- bundle whose translations you're overriding. This is done in ``AppKernel ``.
161-
162- Finally, translations located in ``app/Resources/translations `` will override
163- all the other translations since those files are always loaded last.
164153.. _`the Doctrine documentation` : http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/inheritance-mapping.html#overrides
0 commit comments