title: Call to a member function get_news() on a non-object in C:\xampp\htdocs\CodeIgniter_Practice\application\controllers\news.php on line 11
body: <p>I wrote a small application from CodeIgnitor user guide but when I run it, display the given message</p>
  
  <pre><code>Fatal error: Call to a member function get_news() on a non-object in C:\xampp\htdocs\CodeIgniter_Practice\application\controllers\news.php on line 11
  </code></pre>
  
  <p>The code is</p>
  
  <pre><code>class News extends CI_Controller{
    public function _construct()    
    {
       parent::_construct();   
       $this-&gt;load-&gt;model('news_model');
    }
    public function index()
    {
    $data['news'] = $this-&gt;news_model-&gt;get_news(); 
       $data['title'] = 'News archive';
  
       $this-&gt;load-&gt;view('templates/header',$data);
       $this-&gt;load-&gt;view('news/index',$data);
       $this-&gt;load-&gt;view('templates/footer');
    }
  }
  </code></pre>
  
  <p>Line 11 is : </p>
  
  <pre><code>$data['news'] = $this-&gt;news_model-&gt;get_news();
  </code></pre>