From 7ec6d9d140b41e03853e06bc4c7d85b729115815 Mon Sep 17 00:00:00 2001 From: "tien.xuan.vo" Date: Sat, 30 Nov 2019 23:09:30 +0700 Subject: [PATCH] [DependencyInjection] Bind tagged services --- service_container.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/service_container.rst b/service_container.rst index 44b2d1ee4db..1febe0cf8cc 100644 --- a/service_container.rst +++ b/service_container.rst @@ -665,6 +665,7 @@ You can also use the ``bind`` keyword to bind specific arguments by name or type # optionally you can define both the name and type of the argument to match string $adminEmail: 'manager@example.com' Psr\Log\LoggerInterface $requestLogger: '@monolog.logger.request' + iterable $rules: !tagged_iterator app.foo.rule # ... @@ -695,6 +696,10 @@ You can also use the ``bind`` keyword to bind specific arguments by name or type type="service" id="monolog.logger.request" /> + @@ -728,6 +733,7 @@ You can also use the ``bind`` keyword to bind specific arguments by name or type // optionally you can define both the name and type of the argument to match ->bind('string $adminEmail', 'manager@example.com') ->bind(LoggerInterface::class.' $requestLogger', ref('monolog.logger.request')) + ->bind('iterable $rules', tagged_iterator('app.foo.rule')) ; // ...