Dear forum,
is there a way to set up custom routes which will work in normal as well as multi-language setups?
Since this:
return [
'routes' => [
[
'pattern' => '(:all)',
'language' => '*',
'action' => function ($language, $slug) {
// …
}
],
]
];
will cause an error in normal setups because the $language
variable isn’t passed and this:
return [
'routes' => [
[
'pattern' => '(:all)',
'action' => function ($slug) {
// …
}
],
]
];
will only catch URLs without language code in multi-language setups.
I’m creating a plugin, so my routes should be as universal as possible. Thanks for any hints!