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
243243--------------------------
244244
245245To 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,
You can’t perform that action at this time.
0 commit comments