These is the controller
class Dashboard extends CI_Controller{
public function __construct(){
parent::__construct();
$this->load->model("admin/post_model");
$this->load->model("admin/comment_model");
}
public function index(){
$data['post_res'] = $this->post_model->getPost();
$data['com_res'] = $this->post_model->getComments();
}
}
I cannot load 2 model in the same controller. It gives me an error
Fatal error: Call to a member function getComments() on a non-object in C:\xampp\htdocs\blog\application\controllers\ram-admin\dashboard.php on line 13
How can I possibly load the models?
Thanks you so much in advance!