mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 04:56:23 +00:00
702 B
702 B
id | title |
---|---|
2b3fbe1c-487f-40e0-88aa-a1b6d59093e3 | Fallback For Internationalized Routes |
Introduction
Since Symfony 4.2, it's possible to define internationalized routes without the region part. Symfony will match them ignoring the region part of the locacle.
Syntax
use Symfony\Component\Routing\Annotation\Route;
/**
* @Route({ "en_GB": "/about-us", "en_US": "/about-us" }, name="about")
*/
public function about()
{
// ...
}
can now be defined as
/**
* @Route({ "en": "/about-us" }, name="about")
*/
public function about()
{
// ...
}