@@ -57,15 +57,9 @@ as integration of other related components:
57
57
Using the Bundle Extension
58
58
--------------------------
59
59
60
- The basic idea is that instead of having the user override individual
61
- parameters, you let the user configure just a few, specifically created,
62
- options. As the bundle developer, you then parse through that configuration and
63
- load correct services and parameters inside an "Extension" class.
64
-
65
- As an example, imagine you are creating a social bundle, which provides
66
- integration with Twitter and such. To be able to reuse your bundle, you have to
67
- make the ``client_id `` and ``client_secret `` variables configurable. Your
68
- bundle configuration would look like:
60
+ Imagine you are creating a new bundle - AcmeSocialBundle - which provides
61
+ integration with Twitter, etc. To make your bundle easy to use, you want to
62
+ allow users to configure it with some configuration that looks like this:
69
63
70
64
.. configuration-block ::
71
65
@@ -102,6 +96,17 @@ bundle configuration would look like:
102
96
'client_secret' => 'your_secret',
103
97
));
104
98
99
+ The basic idea is that instead of having the user override individual
100
+ parameters, you let the user configure just a few, specifically created,
101
+ options. As the bundle developer, you then parse through that configuration and
102
+ load correct services and parameters inside an "Extension" class.
103
+
104
+ .. note ::
105
+
106
+ The root key of your bundle configuration (``acme_social `` in the previous
107
+ example) is automatically determined from your bundle name (it's the
108
+ `snake case `_ of the bundle name without the ``Bundle `` suffix ).
109
+
105
110
.. seealso ::
106
111
107
112
Read more about the extension in :doc: `/bundles/extension `.
@@ -439,3 +444,4 @@ Assuming the XSD file is called ``hello-1.0.xsd``, the schema location will be
439
444
.. _`TwigBundle Configuration` : https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php
440
445
.. _`XML namespace` : https://en.wikipedia.org/wiki/XML_namespace
441
446
.. _`XML schema` : https://en.wikipedia.org/wiki/XML_schema
447
+ .. _`snake case` : https://en.wikipedia.org/wiki/Snake_case
0 commit comments