File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1403,7 +1403,7 @@ Instead of duplicating the original route, you can create an alias for it.
1403
1403
1404
1404
class ProductController
1405
1405
{
1406
- // "alias" named argument refers to the name of the alias you want to create.
1406
+ // "alias" named argument indicates the name of the alias you want to create.
1407
1407
// The alias will point to the actual route "product_show"
1408
1408
#[Route('/product/{id}', name: 'product_show', alias: ['product_details'])]
1409
1409
public function show(): Response
@@ -1452,6 +1452,15 @@ Instead of duplicating the original route, you can create an alias for it.
1452
1452
In this example, both ``product_show `` and ``product_details `` routes can
1453
1453
be used in the application and will produce the same result.
1454
1454
1455
+ .. note ::
1456
+
1457
+ Using non-attributes formats (YAML, XML and PHP) is the only way
1458
+ to define an alias pointing to a route that you don't own.
1459
+
1460
+ So that you can use your own route name for URL generation,
1461
+ while actually using a route defined by a third-party bundle as the target of that URL generation,
1462
+ as the 2 definitions are not required to be in the same config file (or even in the same format).
1463
+
1455
1464
.. _routing-alias-deprecation :
1456
1465
1457
1466
Deprecating Route Aliases
You can’t perform that action at this time.
0 commit comments