@@ -36,25 +36,24 @@ implementations if you have a case not handled by the
36
36
{
37
37
public function enhance(array $defaults, Request $request)
38
38
{
39
- // own logic.
39
+ // ... customize the $defaults array
40
40
41
- // Enhancer MUST return the $defaults but may add or remove values.
42
41
return $defaults;
43
42
}
44
43
}
45
44
46
-
47
- Simply define services for your enhancers and tag them with ``dynamic_router_route_enhancer `` to have
48
- them added to the routing. You can specify an optional ``priority `` parameter
49
- on the tag to control the order in which enhancers are executed. The higher the
50
- priority, the earlier the enhancer is executed.
45
+ Simply define services for your enhancers and tag them with
46
+ ``dynamic_router_route_enhancer `` to have them added to the routing. You can
47
+ specify an optional ``priority `` parameter on the tag to control the order in
48
+ which enhancers are executed. The higher the priority, the earlier the enhancer
49
+ is executed.
51
50
52
51
.. configuration-block ::
53
52
54
53
.. code-block :: yaml
55
54
56
55
services :
57
- app.routing.enhancer.simple :
56
+ app.routing.simple_enhancer :
58
57
class : AppBundle\Routing\Enhancer\SimpleEnhancer
59
58
tags :
60
59
- { name: dynamic_router_route_enhancer, priority: 10 }
@@ -67,7 +66,7 @@ priority, the earlier the enhancer is executed.
67
66
xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd" >
68
67
69
68
<services >
70
- <service id =" app.routing.enhancer.simple " class =" AppBundle\Routing\Enhancer\SimpleEnhancer" >
69
+ <service id =" app.routing.simple_enhancer " class =" AppBundle\Routing\Enhancer\SimpleEnhancer" >
71
70
<tag name =" dynamic_router_route_enhancer" priority =" 10" />
72
71
</service >
73
72
</services >
@@ -78,8 +77,11 @@ priority, the earlier the enhancer is executed.
78
77
use Symfony\Component\DependencyInjection\Definition;
79
78
80
79
$definition = new Definition('AppBundle\Routing\Enhancer\SimpleEnhancer');
81
- $definition->addTag('dynamic_router_route_enhancer',array('priority' => 10));
82
- $container->setDefinition('app.routing.enhancer.simple', $definition);
80
+ $definition->addTag('dynamic_router_route_enhancer', array(
81
+ 'priority' => 10,
82
+ ));
83
+
84
+ $container->setDefinition('app.routing.simple_enhancer', $definition);
83
85
84
86
.. index :: Route Provider
85
87
0 commit comments