File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,12 @@ The last step is to update the compiler to take care of your additional informat
231231

232232
$definition = $container->getDefinition('acme_mailer.transport_chain');
233233

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+
}
236238
}
237239
}
238240
}
239241
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.

0 commit comments

Comments
 (0)