Hello,
I'm creating a translation system for my application based on browser language detection of the user.
I need to create a class MY_Router to make Routing and accept the language parameter passed by the URL, Example:
http://www.application.com/en-US/welcome
$route [' default_controller '] = ' welcome ';
$route [' ^ (: any)/(. +) $ '] = ' $2 ';
$route [' ^ (: any) $ '] = $route [' default_controller '];
When passing the parameters for the file config/routers.php the system works perfectly, but I would like to create a MY_Router class to make this language parameter acceptance before the default controller.
Best regards
João Antonio Trocades
I'm creating a translation system for my application based on browser language detection of the user.
I need to create a class MY_Router to make Routing and accept the language parameter passed by the URL, Example:
http://www.application.com/en-US/welcome
$route [' default_controller '] = ' welcome ';
$route [' ^ (: any)/(. +) $ '] = ' $2 ';
$route [' ^ (: any) $ '] = $route [' default_controller '];
When passing the parameters for the file config/routers.php the system works perfectly, but I would like to create a MY_Router class to make this language parameter acceptance before the default controller.
Best regards
João Antonio Trocades