*/ class RegisterParserPluginPass implements CompilerPassInterface { /** * You can modify the container here before it is dumped to PHP code. * * @param ContainerBuilder $container * * @api */ public function process(ContainerBuilder $container) { if (!$container->hasDefinition("thelia.parser")) { return; } $smarty = $container->getDefinition("thelia.parser"); foreach ($container->findTaggedServiceIds("thelia.parser.register_plugin") as $id => $plugin) { $smarty->addMethodCall("addPlugins", array(new Reference($id))); } $smarty->addMethodCall("registerPlugins"); } }