@@ -145,15 +145,18 @@ private function setupDynamicRouter(array $config, ContainerBuilder $container,
145145
146146 // if any mappings are defined, set the respective route enhancer
147147 if (count ($ config ['controllers_by_type ' ]) > 0 ) {
148- $ dynamic ->addMethodCall ('addRouteEnhancer ' , array (new Reference ('cmf_routing.enhancer.controllers_by_type ' ), 60 ));
148+ $ container ->getDefinition ('cmf_routing.enhancer.controllers_by_type ' )
149+ ->addTag ('dynamic_router_route_enhancer ' , array ('priority ' => 60 ));
149150 }
150151
151152 if (count ($ config ['controllers_by_class ' ]) > 0 ) {
152- $ dynamic ->addMethodCall ('addRouteEnhancer ' , array (new Reference ('cmf_routing.enhancer.controllers_by_class ' ), 50 ));
153+ $ container ->getDefinition ('cmf_routing.enhancer.controllers_by_class ' )
154+ ->addTag ('dynamic_router_route_enhancer ' , array ('priority ' => 50 ));
153155 }
154156
155157 if (count ($ config ['templates_by_class ' ]) > 0 ) {
156- $ dynamic ->addMethodCall ('addRouteEnhancer ' , array (new Reference ('cmf_routing.enhancer.templates_by_class ' ), 40 ));
158+ $ container ->getDefinition ('cmf_routing.enhancer.templates_by_class ' )
159+ ->addTag ('dynamic_router_route_enhancer ' , array ('priority ' => 40 ));
157160
158161 /*
159162 * The CoreBundle prepends the controller from ContentBundle if the
@@ -176,15 +179,18 @@ private function setupDynamicRouter(array $config, ContainerBuilder $container,
176179 $ definition = $ container ->getDefinition ('cmf_routing.enhancer.controller_for_templates_by_class ' );
177180 $ definition ->replaceArgument (2 , $ controllerForTemplates );
178181
179- $ dynamic ->addMethodCall ('addRouteEnhancer ' , array (new Reference ('cmf_routing.enhancer.controller_for_templates_by_class ' ), 30 ));
182+ $ container ->getDefinition ('cmf_routing.enhancer.controller_for_templates_by_class ' )
183+ ->addTag ('dynamic_router_route_enhancer ' , array ('priority ' => 30 ));
180184 }
181185
182186 if (null !== $ config ['generic_controller ' ] && $ defaultController !== $ config ['generic_controller ' ]) {
183- $ dynamic ->addMethodCall ('addRouteEnhancer ' , array (new Reference ('cmf_routing.enhancer.explicit_template ' ), 10 ));
187+ $ container ->getDefinition ('cmf_routing.enhancer.explicit_template ' )
188+ ->addTag ('dynamic_router_route_enhancer ' , array ('priority ' => 10 ));
184189 }
185190
186191 if (null !== $ defaultController ) {
187- $ dynamic ->addMethodCall ('addRouteEnhancer ' , array (new Reference ('cmf_routing.enhancer.default_controller ' ), -100 ));
192+ $ container ->getDefinition ('cmf_routing.enhancer.default_controller ' )
193+ ->addTag ('dynamic_router_route_enhancer ' , array ('priority ' => -100 ));
188194 }
189195
190196 if (count ($ config ['route_filters_by_id ' ]) > 0 ) {
0 commit comments