diff --git a/service_container/service_subscribers_locators.rst b/service_container/service_subscribers_locators.rst index 150f9bef638..239209210ac 100644 --- a/service_container/service_subscribers_locators.rst +++ b/service_container/service_subscribers_locators.rst @@ -243,8 +243,8 @@ Defining a Service Locator -------------------------- To manually define a service locator, create a new service definition and add -the ``container.service_locator`` tag to it. Use its ``arguments`` option to -include as many services as needed in it. +the ``container.service_locator`` tag to it. Use the first argument of the +service definition to pass a collection of services to the service locator: .. configuration-block:: @@ -258,6 +258,9 @@ include as many services as needed in it. - App\FooCommand: '@app.command_handler.foo' App\BarCommand: '@app.command_handler.bar' + # if the element has no key, the ID of the original service is used + '@app.command_handler.baz' + # if you are not using the default service autoconfiguration, # add the following tag to the service definition: # tags: ['container.service_locator'] @@ -274,8 +277,10 @@ include as many services as needed in it. - - + + + +