Skip to content

Commit 62c7888

Browse files
committed
minor #14554 Update import.rst (abdounikarim)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- Update import.rst Hello, I just add a configuration if we want to import all configuration of a directory, to avoid multiple imports lines. Commits ------- 9556746 Update import.rst
2 parents 2c7db6b + 9556746 commit 62c7888

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

service_container/import.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ a relative or absolute path to the imported file:
8080
# config/services.yaml
8181
imports:
8282
- { resource: services/mailer.yaml }
83-
83+
# If you want to import a whole directory:
84+
- { resource: services/ }
8485
services:
8586
_defaults:
8687
autowire: true
@@ -103,6 +104,8 @@ a relative or absolute path to the imported file:
103104
104105
<imports>
105106
<import resource="services/mailer.xml"/>
107+
<!-- If you want to import a whole directory: -->
108+
<import resource="services/"/>
106109
</imports>
107110
108111
<services>
@@ -122,6 +125,8 @@ a relative or absolute path to the imported file:
122125
123126
return function(ContainerConfigurator $configurator) {
124127
$configurator->import('services/mailer.php');
128+
// If you want to import a whole directory:
129+
$configurator->import('services/');
125130
126131
$services = $configurator->services()
127132
->defaults()

0 commit comments

Comments
 (0)