File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
components/dependency_injection Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -231,9 +231,12 @@ The last step is to update the compiler to take care of your additional informat
231
231
232
232
$definition = $container->getDefinition('acme_mailer.transport_chain');
233
233
234
- foreach ($container->findTaggedServiceIds('acme_mailer.transport') as $id => $attributes) {
235
- $definition->addMethodCall('addTransport', array(new Reference($id), $attributes[0]["alias"]));
234
+ foreach ($container->findTaggedServiceIds('acme_mailer.transport') as $id => $tagAttributes) {
235
+ foreach ($tagAttributes as $attributes) {
236
+ $definition->addMethodCall('addTransport', array(new Reference($id), $attributes["alias"]));
237
+ }
236
238
}
237
239
}
238
240
}
239
241
242
+ Take care of ``$attributes `` variable. Because you can use the same tag many times on the same service, ``$attributes `` is an array of attributes for each tag that refers to the same service.
You can’t perform that action at this time.
0 commit comments