URI segments with index() of a controller? |
[eluser]inktri[/eluser]
I've got a User controller. I want users to be able to view their profiles with: http://localhost/user/<username> So I added this function into the User controller: Code: function index() however going to url http://localhost/user/<username> produces a 404 error... if I rename the function above to view() and use segment(3), and direct my browser to http://localhost/user/view/<username> everything works fine. Anybody know what I'm doing wrong with the index() case? Thanks
[eluser]wiredesignz[/eluser]
Yep. CI will try to locate the username as a method of the controller. You may like to consider _remap() instead. Or use routes. Good Luck and Welcome to the forums.
|
Welcome Guest, Not a member yet? Register Sign In |