<?php  
defined('BASEPATH') OR exit('No direct script access allowed');  
  
class Main extends CI_Controller {  
      
    public function index()  
    {  
        $this->load->view('hello_world');  
    }  
	
	public function getMainCategories() {
		
		$this->load->model('Maindata');
		
		$mainCategories = $this->Maindata->fetchMainCategories();
		
		echo json_encode($mainCategories);
		//echo($mainCategories);
		
	}
}  
?>  