How to get URLs like /user/bob user/martin dynamically in CodeIgniter?
+6
A:
You need to set up custom routing for the controller in application/config/routes.php, e.g.
$route['user/(:any)'] = "user/user_controller_method/$1";
James
2010-09-13 11:33:05
+2
A:
you should use the
$route['user/(:any)'] = "user/user_controller_method/$1";
as James suggested, and then define the funcion on the user controller:
function user_controller_method($username) {
// ... $username should be the url param
}
ilbesculpi
2010-09-13 16:12:44