@@ -57,15 +57,9 @@ as integration of other related components:
5757Using the Bundle Extension
5858--------------------------
5959
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:
6963
7064.. configuration-block ::
7165
@@ -102,6 +96,17 @@ bundle configuration would look like:
10296 'client_secret' => 'your_secret',
10397 ));
10498
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+
105110.. seealso ::
106111
107112 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
439444.. _`TwigBundle Configuration` : https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php
440445.. _`XML namespace` : https://en.wikipedia.org/wiki/XML_namespace
441446.. _`XML schema` : https://en.wikipedia.org/wiki/XML_schema
447+ .. _`snake case` : https://en.wikipedia.org/wiki/Snake_case
0 commit comments