I am using Codeigniter 2 and am currently using the ‘Routers’ config file to set the routes.
I am also using IonAuth library.
I have a code that does something like:
$route['admin/(login|logout|change_password|forgot_password|reset_password
|activate|deactivate|create_user)'] = "auth/$1";
Now my problem is that, in some of the IonAuth methods, there are none, 1 or 2 parameters.
If I try to access the url like:
http://localhost/ion_auth_try/admin/deactivate/1
I get an 404 error.
The signature of the ‘deactivate’ method is
function deactivate($id = NULL)
I’ve been trying to solve this for a long time now. I’m stuck.
If I were you, I’d do this instead.
It’s much more simpler and it solves the problem perfectly. With the above rule, you can access both
admin/some_methodandadmin/some_other_method/with_a_parameterjust fine. However, you should note that if you were to access the page by entering justadmin, you’d need to add the following:See the doc: http://codeigniter.com/user_guide/general/routing.html