@@ -1318,8 +1318,7 @@ the ``template`` option:
1318
1318
Redirecting to URLs and Routes
1319
1319
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1320
1320
1321
- Use the ``RedirectController `` to redirect to other routes (``redirectAction ``)
1322
- and URLs (``urlRedirectAction ``):
1321
+ Use the ``RedirectController `` to redirect to other routes and URLs:
1323
1322
1324
1323
.. configuration-block ::
1325
1324
@@ -1328,7 +1327,7 @@ and URLs (``urlRedirectAction``):
1328
1327
# config/routes.yaml
1329
1328
doc_shortcut :
1330
1329
path : /doc
1331
- controller : Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction
1330
+ controller : Symfony\Bundle\FrameworkBundle\Controller\RedirectController
1332
1331
defaults :
1333
1332
route : ' doc_page'
1334
1333
# optionally you can define some arguments passed to the route
@@ -1345,7 +1344,7 @@ and URLs (``urlRedirectAction``):
1345
1344
1346
1345
legacy_doc :
1347
1346
path : /legacy/doc
1348
- controller : Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction
1347
+ controller : Symfony\Bundle\FrameworkBundle\Controller\RedirectController
1349
1348
defaults :
1350
1349
# this value can be an absolute path or an absolute URL
1351
1350
path : ' https://legacy.example.com/doc'
@@ -1361,7 +1360,7 @@ and URLs (``urlRedirectAction``):
1361
1360
https://symfony.com/schema/routing/routing-1.0.xsd" >
1362
1361
1363
1362
<route id =" doc_shortcut" path =" /doc"
1364
- controller =" Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction " >
1363
+ controller =" Symfony\Bundle\FrameworkBundle\Controller\RedirectController" >
1365
1364
<default key =" route" >doc_page</default >
1366
1365
<!-- optionally you can define some arguments passed to the route -->
1367
1366
<default key =" page" >index</default >
@@ -1377,7 +1376,7 @@ and URLs (``urlRedirectAction``):
1377
1376
</route >
1378
1377
1379
1378
<route id =" legacy_doc" path =" /legacy/doc"
1380
- controller =" Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction " >
1379
+ controller =" Symfony\Bundle\FrameworkBundle\Controller\RedirectController" >
1381
1380
<!-- this value can be an absolute path or an absolute URL -->
1382
1381
<default key =" path" >https://legacy.example.com/doc</default >
1383
1382
<!-- redirections are temporary by default (code 302) but you can make them permanent (code 301)-->
@@ -1394,7 +1393,7 @@ and URLs (``urlRedirectAction``):
1394
1393
1395
1394
return function (RoutingConfigurator $routes) {
1396
1395
$routes->add('doc_shortcut', '/doc')
1397
- ->controller([ RedirectController::class, 'redirectAction'] )
1396
+ ->controller(RedirectController::class)
1398
1397
->defaults([
1399
1398
'route' => 'doc_page',
1400
1399
// optionally you can define some arguments passed to the template
@@ -1412,7 +1411,7 @@ and URLs (``urlRedirectAction``):
1412
1411
;
1413
1412
1414
1413
$routes->add('legacy_doc', '/legacy/doc')
1415
- ->controller([ RedirectController::class, 'urlRedirectAction'] )
1414
+ ->controller(RedirectController::class)
1416
1415
->defaults([
1417
1416
// this value can be an absolute path or an absolute URL
1418
1417
'path' => 'https://legacy.example.com/doc',
0 commit comments