I am new to Codeigniter but for some reason I can’t get it working. What I am trying to do is very simple. I have a post.php file inside controller folder. Contents of post.php is as following:
class Posts extends CI_Controller{
function index(){
$this->load->view('hello.php');
}
}
Then my hello.php file is inside views folder. It is just a static HTML page. Just trying to get it working first.
The folder structure is a follows: htdocs/codeignitor
I was expecting to get contents of hello.php when I visit:
http://localhost:8888/codeigniter/index.php/posts
When I visit the above url it says Page Not Found. But the default welcome page is working fine.
Your files should be placed as follows: