Reputation: 1306
I need to send a var (an int with value 3) to an index function in a controller.
No problems with that, except the url looks like this:
tasks/index/3
I want the url to be like this:
tasks/
I tried this in the routes.php, but then it gives an error saying the page can't be found.
$route['tasks/index/(:num)'] = 'tasks';
Upvotes: 1
Views: 128
Reputation: 2117
It's the other way around.
Try doing:
$route['tasks/(:num)'] = 'tasks/index/$1';
Upvotes: 2