My problem is when I run the controller in the wamp server it will go to posts class and start executing the index function but how that happens ? If I change the function name that won't work - how is that possible? Can you explain the procedure behind this?
class posts extends CI_Controller {
function index(){
$this->load->model('post');
$data['posts'] = $this->post->get_posts();
$this->load->view('post_index',$data);
}
}
In CI if the controller has index function then it automatically loads index method . Please read it here https://ellislab.com/codeigniter/user-guide/general/controllers.html