@@ -12,11 +12,10 @@ users to choose to remove functionality they are not using. Creating multiple
12
12
bundles has the drawback that configuration becomes more tedious and settings
13
13
often need to be repeated for various bundles.
14
14
15
- It is possible to remove the disadvantage of the multiple bundle approach
16
- by enabling a single Extension to prepend the settings for any bundle.
17
- It can use the settings defined in the ``app/config/config.yml ``
18
- to prepend settings just as if they had been written explicitly by
19
- the user in the application configuration.
15
+ It is possible to remove the disadvantage of the multiple bundle approach by
16
+ enabling a single Extension to prepend the settings for any bundle. It can use
17
+ the settings defined in the ``config/* `` files to prepend settings just as if
18
+ they had been written explicitly by the user in the application configuration.
20
19
21
20
For example, this could be used to configure the entity manager name to use in
22
21
multiple bundles. Or it can be used to enable an optional feature that depends
@@ -50,7 +49,7 @@ prepend settings to a bundle extension developers can use the
50
49
:method: `Symfony\\ Component\\ DependencyInjection\\ ContainerBuilder::prependExtensionConfig `
51
50
method on the :class: `Symfony\\ Component\\ DependencyInjection\\ ContainerBuilder `
52
51
instance. As this method only prepends settings, any other settings done explicitly
53
- inside the ``app/ config/config.yml `` would override these prepended settings.
52
+ inside the ``config/* `` files would override these prepended settings.
54
53
55
54
The following example illustrates how to prepend
56
55
a configuration setting in multiple bundles as well as disable a flag in multiple bundles
@@ -73,7 +72,7 @@ in case a specific other bundle is not registered::
73
72
// acme_something and acme_other
74
73
//
75
74
// note that if the user manually configured
76
- // use_acme_goodbye to true in app/ config/config.yml
75
+ // use_acme_goodbye to true in config/services.yaml
77
76
// then the setting would in the end be true and not false
78
77
$container->prependExtensionConfig($name, $config);
79
78
break;
@@ -96,14 +95,15 @@ in case a specific other bundle is not registered::
96
95
}
97
96
98
97
The above would be the equivalent of writing the following into the
99
- ``app/config/config.yml `` in case AcmeGoodbyeBundle is not registered and the
100
- ``entity_manager_name `` setting for ``acme_hello `` is set to ``non_default ``:
98
+ ``config/packages/acme_something.yaml `` in case AcmeGoodbyeBundle is not
99
+ registered and the ``entity_manager_name `` setting for ``acme_hello `` is set to
100
+ ``non_default ``:
101
101
102
102
.. configuration-block ::
103
103
104
104
.. code-block :: yaml
105
105
106
- # app/ config/config.yml
106
+ # config/packages/acme_something.yaml
107
107
acme_something :
108
108
# ...
109
109
use_acme_goodbye : false
@@ -115,7 +115,7 @@ The above would be the equivalent of writing the following into the
115
115
116
116
.. code-block :: xml
117
117
118
- <!-- app/ config/config .xml -->
118
+ <!-- config/packages/acme_something .xml -->
119
119
<?xml version =" 1.0" encoding =" UTF-8" ?>
120
120
<container xmlns =" http://symfony.com/schema/dic/services"
121
121
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
@@ -134,7 +134,7 @@ The above would be the equivalent of writing the following into the
134
134
135
135
.. code-block :: php
136
136
137
- // app/ config/config .php
137
+ // config/packages/acme_something .php
138
138
$container->loadFromExtension('acme_something', array(
139
139
// ...
140
140
'use_acme_goodbye' => false,
0 commit comments