mirror of
https://github.com/symfony/symfony-docs.git
synced 2026-03-23 16:22:10 +01:00
Merge branch '6.4' into 7.3
* 6.4: [Routing] Default path for localized routes
This commit is contained in:
@@ -2281,6 +2281,9 @@ avoids the need for duplicating routes, which also reduces the potential bugs:
|
||||
#[Route(path: [
|
||||
'en' => '/about-us',
|
||||
'nl' => '/over-ons'
|
||||
// optionally, you can define a path without a locale. It will be used
|
||||
// for any locale that does not match the locales above
|
||||
'/about-us',
|
||||
], name: 'about_us')]
|
||||
public function about(): Response
|
||||
{
|
||||
@@ -2322,6 +2325,9 @@ avoids the need for duplicating routes, which also reduces the potential bugs:
|
||||
$routes->add('about_us', [
|
||||
'en' => '/about-us',
|
||||
'nl' => '/over-ons',
|
||||
// optionally, you can define a path without a locale. It will be used
|
||||
// for any locale that does not match the locales above
|
||||
'/about-us',
|
||||
])
|
||||
->controller([CompanyController::class, 'about'])
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user