title: Load a library in a model in CodeIgniter
body: <p>Why won't my model load the encryption library?</p>
  
  <pre><code>class User_model extends Model {
  
    function User_model() {
      parent::Model();
      $this-&gt;check_login();
    }
  
    function check_login() {
      $this-&gt;load-&gt;library('encrypt');
      $email = $this-&gt;encrypt-&gt;decode($email);
      ....
    }
  }
  </code></pre>
  
  <p>This giving me a PHP error: Call to a member function decode() on a non-object on line X -- where X is the $this->encrypt->decode($email); line?</p>
  
  <p><em>Edited to show that the problem was that check_login was called from the constructor</em></p>