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.
A sample filter in my application is as written below
class Trust_filter extends Filter{
function before(){
$this->ci=&get_instance();
if($this->ci->auth->is_user_active()){
$this->ci->load->model("trust_model","trustmanager");
if($this->trustmanager->verify()){
echo "##090##";
}
}
}
}
The above code doesnt 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.
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.