I want to combine multi router at once. Following example, i have 2 router each language for one page.
For english search page:
$router->add('/search', array(
'controller' => 'search',
'action' => 'index'
))->setName('search-en');
For turkish search page:
$router->add('/{lang:[a-z]{2}}/arama', array(
'controller' => 'search',
'action' => 'index',
))->setName('search-tr');
I have to seperate to call for each language.
For english link:
$this->url->get(['for' => 'search-en']); // /search
For Turkish link:
$this->url->get(['for' => 'search-tr']); // /arama
I'm using dynamic vars for temp solution:
$lang = defaultLang();
$this->url->get(['for' => "search-{$lang}"]);
I was expecting single router for each language (could be with array) and will be usage:
$this->url->get(['for' => 'search']); // will generate url matched
Any idea or solution about that?
Thanks