Welcome Guest, Not a member yet? Register   Sign In
dynamic route
#1

hi, how can i add new routes dynamically? directly in the controller, like this:

PHP Code:
class Users extends CI_Controller {

 
   public function __remap()
 
   {
 
       $route['username'] = 'users/profile/user_id'// username and user_id r from the db
 
   }

 
   public function profile($user_id)
 
   {
 
       // ...
 
   }


the __remap also can be in MY_Controller, it doesn't matter, the main is the result

any idea?
Reply


Messages In This Thread
dynamic route - by Tecvid - 09-06-2016, 04:48 AM
RE: dynamic route - by dave friend - 09-07-2016, 09:25 AM
RE: dynamic route - by Tecvid - 09-08-2016, 12:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB