How to use a library in the MY_Loader-Class - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: How to use a library in the MY_Loader-Class (/showthread.php?tid=59815) |
How to use a library in the MY_Loader-Class - El Forum - 11-23-2013 [eluser]axelf[/eluser] Hi, i want to use a library in the MY_Loader Class. How can i load this library into the MY_Loader-Class? The Library is named Language and is in application/libraries/Language.php. In autoload.php i added 'language' in $autoload['libraries']-array. In the My_Loader Class i want to use $this->language, but it does not work. What i am doing wrong? Code: class MY_Loader extend CI_Loader { How to use a library in the MY_Loader-Class - El Forum - 11-23-2013 [eluser]Tpojka[/eluser] Add the constructor. Code: class MY_Loader extend CI_Loader { How to use a library in the MY_Loader-Class - El Forum - 11-23-2013 [eluser]axelf[/eluser] Hi, this is my Loader Class. It dosn't work with the constructor. i have to use the CI-Objekt, but why? The Library will be loaded automatically, but now i have to load this in the class? Code: // config: How to use a library in the MY_Loader-Class - El Forum - 11-23-2013 [eluser]Tpojka[/eluser] Only explanation is that file is loaded after controller. How to use a library in the MY_Loader-Class - El Forum - 11-23-2013 [eluser]axelf[/eluser] Hi, thank you for helping. Using the CI-Object is the right way? How to use a library in the MY_Loader-Class - El Forum - 11-23-2013 [eluser]Tpojka[/eluser] User guide perfectly agrees. |