Welcome Guest, Not a member yet? Register   Sign In
MY_Loader.php doesn't appear to be loading
#1

[eluser]Dave Stewart[/eluser]
Hi All,
I'm hoping I've just missed something obvious, but my custom extended Loader class isn't being fired. I've:

- named it MY_Loader.php
- placed it in application/libraries
- included the call to parent::CI_Loader() in the constructor MY_Loader()
- uploaded the file

Any ideas?

Thanks,
Dave
#2

[eluser]Pascal Kriete[/eluser]
The loader is special in php4, because the CI super-object inherits from it. You will need to change codeigniter/base4.php to use MY_Loader instead of CI_Loader.
#3

[eluser]Dave Stewart[/eluser]
Thanks for the info - all is up and running now.

For anyone else's info, you need to change the CI_Base class to look like this:

Code:
class CI_Base extends MY_Loader {

    function CI_Base()
    {
        // This allows syntax like $this->load->foo() to work
        parent::MY_Loader();
        $this->load =& $this;
        
        // This allows resources used within controller constructors to work
        global $OBJ;
        $OBJ = $this->load; // Do NOT use a reference.
    }
}




Theme © iAndrew 2016 - Forum software by © MyBB