Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14114

Creating routing class "MY_Router"

$
0
0
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

Viewing all articles
Browse latest Browse all 14114


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>