title: CodeIgniter Undefined property when loading a model
body: <p>I'm receiving the following errors whilst trying to implement a very simple model controller in codeigniter. I'm new to the framework but as far as I can see this should work. </p>
  
  <p>I've also tried auto loading the model. I am autoloading the database library.</p>
  
  <pre><code>Message: Undefined property: User::$user_model
  
  Fatal error: Call to a member function get_user() on a non-object
  </code></pre>
  
  <p>The model</p>
  
  <pre><code>class User_model extends CI_Model
  {
  
  function __construct()
  {
      parent::__construct();
  }
  
  
  function get_user()
  {
      return "test";
  }
  
  
  }
  </code></pre>
  
  <p>The controller</p>
  
  <pre><code>class User extends CI_Controller
  {
  
  public function __construct()
  {
      parent::__construct();
  }
  
  function index()
  {
      $this-&gt;load-&gt;model('User_model');
  
      $data['value'] = $this-&gt;User_model-&gt;get_user();
  
      $this-&gt;load-&gt;view('user_edit', $data);
  }
  }
  </code></pre>
  
  <p>Thanks</p>