Skip to content

Commit 73d28f1

Browse files
committed
[cookbook][bundles] Making progress toward #735
1 parent a624841 commit 73d28f1

File tree

2 files changed

+57
-18
lines changed

2 files changed

+57
-18
lines changed

book/templating.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,11 @@ template doesn't exist there, it continues by checking inside the
10301030
templates can be overridden by placing them in the correct ``app/Resources``
10311031
subdirectory.
10321032

1033+
.. note::
1034+
1035+
You can also override templates from within a bundle by using bundle
1036+
inheritance. For more information, see :doc:`/cookbook/bundles/inheritance`.
1037+
10331038
.. _templating-overriding-core-templates:
10341039

10351040
.. index::

cookbook/bundles/override.rst

+52-18
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,55 @@
44
How to Override any Part of a Bundle
55
====================================
66

7-
This article has not been written yet, but will soon. If you're interested
8-
in writing this entry, see :doc:`/contributing/documentation/overview`.
9-
10-
This topic is meant to show how you can override each and every part of a
11-
bundle, both from your application and from other bundles. This may include:
12-
13-
* Templates
14-
* Routing
15-
* Controllers
16-
* Services & Configuration
17-
* Entities & Entity mapping
18-
* Forms
19-
* Validation metadata
20-
21-
In some cases, this may talk about the best practices that a bundle must
22-
use in order for certain pieces to be overridable (or easily overridable).
23-
We may also talk about how certain pieces *aren't* really overridable, but
24-
your best approach at solving your problems anyways.
7+
This document is a quick reference for how to override different parts of
8+
third-party bundles.
9+
10+
Templates
11+
---------
12+
13+
For information on overriding templates, see
14+
* :ref:`overriding-bundle-templates`.
15+
* :doc:`/cookbook/bundles/inheritance`
16+
17+
Routing
18+
-------
19+
20+
Routing is never automatically imported in Symfony2. If you want to include
21+
the routes from any bundle, then they must be manually imported from somewhere
22+
in your application (e.g. ``app/config/routing.yml``).
23+
24+
The easiest way to "override" a bundle's routing is to never import it at
25+
all. Instead of importing a third-party bundle's routing, simply copying
26+
that routing file into your application, modify it, and import it instead.
27+
28+
Controllers
29+
-----------
30+
31+
Assuming the third-party bundle involved uses non-service controllers (which
32+
is almost always the case), you can easily override controllers via bundle
33+
inheritance. For more information, see :doc:`/cookbook/bundles/inheritance`.
34+
35+
Services & Configuration
36+
------------------------
37+
38+
In progress...
39+
40+
Entities & Entity mapping
41+
-------------------------
42+
43+
In progress...
44+
45+
Forms
46+
-----
47+
48+
In progress...
49+
50+
Validation metadata
51+
-------------------
52+
53+
In progress...
54+
55+
Translations
56+
------------
57+
58+
In progress...

0 commit comments

Comments
 (0)