Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbc5ef85

Browse files
codedmonkeyjaviereguiluz
authored andcommitted
[DependencyInjection] Add documentation for service locator changes
1 parent61f4ecc commitbc5ef85

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎service_container/service_subscribers_locators.rst‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ Defining a Service Locator
243243
--------------------------
244244

245245
To manually define a service locator, create a new service definition and add
246-
the ``container.service_locator`` tag to it. Use its ``arguments`` option to
247-
include as many services as needed in it.
246+
the ``container.service_locator`` tag to it. Use the first argument of the
247+
service definition to pass a collection of services to the service locator. If
248+
there is no id specified for the service it will inherit its external id.
248249

249250
..configuration-block::
250251

@@ -306,6 +307,16 @@ include as many services as needed in it.
306307
// ->addTag('container.service_locator')
307308
;
308309
310+
..versionadded::4.1
311+
The service locator autoconfiguration was introduced in Symfony 4.1. In
312+
previous Symfony versions you always needed to add the
313+
``container.service_locator`` tag explicitly.
314+
315+
..versionadded::4.2
316+
317+
The ability to add services without specifying an id was introduced in
318+
Symfony 4.2.
319+
309320
..note::
310321

311322
The services defined in the service locator argument must include keys,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp