@@ -5,7 +5,8 @@ How to Override any Part of a Bundle
5
5
====================================
6
6
7
7
This 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.
9
10
10
11
.. tip ::
11
12
@@ -18,10 +19,7 @@ third-party bundles.
18
19
Templates
19
20
---------
20
21
21
- For information on overriding templates, see
22
-
23
- * :doc: `/templating/overriding `.
24
- * :doc: `/bundles/inheritance `
22
+ See :doc: `/templating/overriding `.
25
23
26
24
Routing
27
25
-------
@@ -37,10 +35,10 @@ that routing f
8000
ile into your application, modify it, and import it instead.
37
35
Controllers
38
36
-----------
39
37
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 `.
43
38
If 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).
44
42
45
43
Services & Configuration
46
44
------------------------
@@ -152,13 +150,4 @@ Translations are not related to bundles, but to domains. That means that you
152
150
can override the translations from any translation file, as long as it is in
153
151
:ref: `the correct domain <using-message-domains >`.
154
152
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.
164
153
.. _`the Doctrine documentation` : http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/inheritance-mapping.html#overrides
0 commit comments