title: CodeIgniter load multiple model in same controller
body: <p>These is the controller</p>
  
  <pre><code>class Dashboard extends CI_Controller{
  public function __construct(){
      parent::__construct();
      $this-&gt;load-&gt;model("admin/post_model");
      $this-&gt;load-&gt;model("admin/comment_model");
  }
      public function index(){
      $data['post_res'] = $this-&gt;post_model-&gt;getPost();
      $data['com_res']  = $this-&gt;post_model-&gt;getComments();
      }
   }
  </code></pre>
  
  <p>I cannot load 2 model in the same controller. It gives me an error</p>
  
  <pre><code>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
  </code></pre>
  
  <p>How can I possibly load the models?</p>
  
  <p>Thanks you so much in advance!</p>