62
62
</mapping >
63
63
</auto-mapping >
64
64
65
- For the redirect to work you will also need to configure a redirect controller
66
- in the ``cmf_routing `` configuration:
65
+ For the redirect to take place you will need to tell the ``DynamicRouter `` to
66
+ route routes with the type ``cmf_routing_auto.redirect `` to a controller which
67
+ can perform the redirect.
68
+
69
+ The RoutingAutoBundle has included such a controller for your convenience. It
70
+ can be configured as follows:
67
71
68
72
.. configuration-block ::
69
73
@@ -73,7 +77,9 @@ in the ``cmf_routing`` configuration:
73
77
cmf_routing :
74
78
dynamic :
75
79
controllers_by_class :
76
- Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute : cmf_routing.redirect_controller:redirectAction
80
+ # ...
81
+ controllers_by_type :
82
+ cmf_routing_auto.redirect : cmf_routing_auto.redirect_controller:redirectAction
77
83
78
84
.. code-block :: xml
79
85
@@ -83,9 +89,9 @@ in the ``cmf_routing`` configuration:
83
89
84
90
<config xmlns =" http://cmf.symfony.com/schema/dic/routing" >
85
91
<dynamic >
86
- <controller-by-class
87
- class = " Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute " >
88
- cmf_routing .redirect_controller:redirectAction
92
+ <controller-by-type
93
+ type = " cmf_routing_auto.redirect " >
94
+ cmf_routing_auto .redirect_controller:redirectAction
89
95
</controller-by-class >
90
96
</dynamic >
91
97
</config >
@@ -97,8 +103,8 @@ in the ``cmf_routing`` configuration:
97
103
// app/config/config.php
98
104
$container->loadFromExtension('cmf_routing', array(
99
105
'dynamic' => array(
100
- 'controllers_by_class ' => array(
101
- 'Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute ' => 'cmf_routing .redirect_controller:redirectAction',
106
+ 'controllers_by_type ' => array(
107
+ 'cmf_routing_auto.redirect ' => 'cmf_routing_auto .redirect_controller:redirectAction'
102
108
),
103
109
),
104
110
));
0 commit comments