Route / cannot access function in my controller |
[eluser]leaflashdev[/eluser]
Hello I set up a simple project I created a controller called portfolio.php in the /controllers/ folder inside the routes.php class I wrote this line $route['default_controller'] = "portfolio"; So now if I go on http://localhost:8888/portfolio/ it access my function called index but If I do http://localhost:8888/portfolio/index or http://localhost:8888/portfolio/dosomething it seems that the function is not found Don't really know why I tried to replace $route['default_controller'] = "portfolio/dosomething"; and when I go back to http://localhost:8888/portfolio I have my echo test function dosomething(){ echo 'test'; } Any ideas ? Thanks !
[eluser]leaflashdev[/eluser]
Ok just figured out that I have to write that to access my dosomething function http://localhost:8888/portfolio/index.ph...osomething Is there a way I can just do that ? http://localhost:8888/portfolio/dosomething Thanks for your help !
[eluser]virtualgadjo[/eluser]
Hi, yes, quite simply, just add this in your root htaccess file Code: RewriteEngine on ![]() have swing
|
Welcome Guest, Not a member yet? Register Sign In |