File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -243,8 +243,9 @@ Defining a Service Locator
243
243
--------------------------
244
244
245
245
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.
248
249
249
250
.. configuration-block ::
250
251
@@ -306,6 +307,16 @@ include as many services as needed in it.
306
307
// ->addTag('container.service_locator')
307
308
;
308
309
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
+
309
320
.. note ::
310
321
311
322
The services defined in the service locator argument must include keys,
You can’t perform that action at this time.
0 commit comments