Welcome Guest, Not a member yet? Register   Sign In
Controller Re-Routing
#1

[eluser]Daeli[/eluser]
Hello guys,

i have a small Problem. I have 2 Classes that have the same name. User as library and User as Controller. Now i want to route all requests from /user to the controller i renamed to /c_user . Is there a chance ?

Thanks,
daeli
#2

[eluser]tonanbarbarian[/eluser]
I would rename the library instead.
Keep the controller names User and change the library to something like Userlib
#3

[eluser]Michael Wales[/eluser]
I agree with tonan, but just to give you the option:

Code:
$route['user/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)'] = "c_user/$1/$2";
$route['user/([a-zA-Z0-9_-]+)'] = "c_user/$1";
$route['user'] = "c_user";

If you have some methods that require 2 parameters, just copy the top line, add another regex segment, and place it above the ones I provided.




Theme © iAndrew 2016 - Forum software by © MyBB