title: How do I load my models inside a codeigniter hook file
body: <p>Here's my issue. I am building an application that requires filters. I have gotten the filter system working and I can even pinpoint the actual method i want to access @ the moment. The issue is that I cannot access the CI core from the filter file. I have searched across the web and while I have found some suggested solutions like "Dipping into CI", they are not recommended because they can cause unstable PHP applications.</p>
  
  <p>A sample filter in my application is as written below</p>
  
  <pre><code>class Trust_filter extends Filter {
    function before() {
      $this -&gt; ci = &amp;get_instance();
      if ($this -&gt; ci -&gt; auth -&gt; is_user_active()) {
        $this -&gt; ci -&gt; load -&gt; model("trust_model", "trustmanager");
        if ($this -&gt; trustmanager -&gt; verify()) {
          echo "##090##";
        }
      }
    }
  }
  </code></pre>
  
  <p>The above code doesn't work because the CI object is a non-object. I can't get an instance and I have spent a whole night on this fruitlessly. I am using CodeIgniter 1.7.1 .Any help will be appreciated. </p>
  
  <p>Edit: I have found an answer to the question. I extended the filters system to work after the constructor has been created to ensure I would have access to the CI superobject. My code works perfectly too. thanks all but I am still interested in your solutions.</p>