I am new to Codeigniter. While trying to access controller specific method, I am getting ‘Object Not found‘ exception.
Before hitting the url I did following changes:
- base_url set as
http://localhost/test/in config.php - default_controller set as
main - Defined index and login method in main.php class
If I try to hit just http://localhost/test/, it returns echo from the index method. But if I directly give http://localhost/test/main/login then it throws Object not found exception.
Strangely if I give $this->login(); into index method of main controller class, http://localhost/test/hits the login method. I have tried to change login method to public but no luck.
What I am missing here?
It seems to be the common
index.phpproblemThis should do it: http://ellislab.com/codeigniter/user-guide/general/urls.html
But please confirm it by trying to access the controller with a
index.phpin behind it like so: