Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 4d177d5

Browse files
committed
Fixed configuration example for defunct redirect
1 parent 27a6b76 commit 4d177d5

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

bundles/routing_auto/defunct_route_handlers.rst

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,12 @@ path.
6262
</mapping>
6363
</auto-mapping>
6464
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:
6771

6872
.. configuration-block::
6973

@@ -73,7 +77,9 @@ in the ``cmf_routing`` configuration:
7377
cmf_routing:
7478
dynamic:
7579
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
7783
7884
.. code-block:: xml
7985
@@ -83,9 +89,9 @@ in the ``cmf_routing`` configuration:
8389
8490
<config xmlns="http://cmf.symfony.com/schema/dic/routing">
8591
<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
8995
</controller-by-class>
9096
</dynamic>
9197
</config>
@@ -97,8 +103,8 @@ in the ``cmf_routing`` configuration:
97103
// app/config/config.php
98104
$container->loadFromExtension('cmf_routing', array(
99105
'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'
102108
),
103109
),
104110
));

0 commit comments

Comments
 (0)