From cc251044b465081343d7770c54cc3a6f0b87e111 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 22 Jan 2026 15:48:34 +0100 Subject: [PATCH] [Routing] Default path for localized routes --- routing.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routing.rst b/routing.rst index 9808949a75..f9ae175339 100644 --- a/routing.rst +++ b/routing.rst @@ -2199,6 +2199,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 { @@ -2240,6 +2243,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']) ;