Library Loading - Error - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Library Loading - Error (/showthread.php?tid=50287) |
Library Loading - Error - El Forum - 03-21-2012 [eluser]Shiju S S[/eluser] I have extended CI_Loader: Code: class Loader extends CI_Loader Used it in another library file Site_Manager like this: Code: $this->load->library('loader'); I am getting an error Quote:A PHP Error was encountered My Module files are located in Quote:htdocs/backendpro/ Please help. Library Loading - Error - El Forum - 03-21-2012 [eluser]PhilTem[/eluser] 1) You don't have to load the loader class, since it's automatically loaded when your CI::APP is initiated. Otherwise you won't even be able to load the loader class. See the recursion? 2) Did you read the user guide? If you want to extend a core library, you have to use your subclass_prefix which is defined in ./application/config/config.php. If you extended the CI_Loader class properly, it will automatically be loaded, too. 3) The loader class is assigned as Code: $this->load->some_method() Library Loading - Error - El Forum - 03-21-2012 [eluser]Shiju S S[/eluser] I changed code to Code: class Loader Same problem Library Loading - Error - El Forum - 03-21-2012 [eluser]PhilTem[/eluser] You still ought to actually change the name of your library to Code: class MY_Loader extends CI_Loader if you want to extend the CI_Loader and want the class to be autoloaded right when CI_Loader is loaded. |