@@ -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,12 +96,16 @@ 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.
105
103
106
- .. tip ::
104
+ .. note ::
107
105
108
- The root node of your bundle configuration must match the name of your
109
- bundle without the 'Bundle' suffix in camel case. For example
110
- `` AcmeSocialBundle `` becomes `` acme_social `` .
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 ) .
111
109
112
110
.. seealso ::
113
111
@@ -446,3 +444,4 @@ Assuming the XSD file is called ``hello-1.0.xsd``, the schema location will be
446
444
.. _`TwigBundle Configuration` : https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php
447
445
.. _`XML namespace` : https://en.wikipedia.org/wiki/XML_namespace
448
446
.. _`XML schema` : https://en.wikipedia.org/wiki/XML_schema
447
+ .. _`snake case` : https://en.wikipedia.org/wiki/Snake_case
0 commit comments