Skip to content

Update import.rst #14554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion service_container/import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ a relative or absolute path to the imported file:
# config/services.yaml
imports:
- { resource: services/mailer.yaml }

# If you want to import a whole directory:
- { resource: services/ }
services:
_defaults:
autowire: true
Expand All @@ -103,6 +104,8 @@ a relative or absolute path to the imported file:

<imports>
<import resource="services/mailer.xml"/>
<!-- If you want to import a whole directory: -->
<import resource="services/"/>
</imports>

<services>
Expand All @@ -122,6 +125,8 @@ a relative or absolute path to the imported file:

return function(ContainerConfigurator $configurator) {
$configurator->import('services/mailer.php');
// If you want to import a whole directory:
$configurator->import('services/');

$services = $configurator->services()
->defaults()
Expand Down