Rename controller |
I was just trying to do a tutorial about multilanguage site subject (http://avenir.ro/create-cms-using-codeig...deigniter/), and I got to this part that you are asking about. What I was thinking is something in the lines of this:
I thought of doing the language things inside the routes.php. First of all, I associated "controllers" and "methods" of other languages to the controllers and methods we have defined (this one is done manually, unless you think of another method): PHP Code: $controllers_methods = array( Then, I just return a callback function when someone asks for a controller and method in a particular language: PHP Code: $route['^(\w{2})/(.*)'] = function($language, $link) use ($controllers_methods) So, in the end the router.php would look something like this: PHP Code: <?php What do you think? Any inputs? Website: http://avenir.ro
|
Messages In This Thread |
Rename controller - by superheld - 02-08-2015, 09:15 AM
RE: Rename controller - by Avenirer - 02-09-2015, 03:22 AM
RE: Rename controller - by superheld - 02-18-2015, 02:27 PM
|