Welcome Guest, Not a member yet? Register   Sign In
How to use a library in the MY_Loader-Class
#3

[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:
$autoload['libraries'] = array('database','form_validation','session','email','language');

class MY_Loader extends CI_Loader {

    function __construct() {
        parent::__construct();
    }

    function lang_view($view, $vars=array()) {
        // this works
        //$CI =& get_instance();
        //$CI->load->library('language');
        //$lang = $CI->language->get();
        
        // this does not work
        $lang = $this->language->get()        
    }
}


Messages In This Thread
How to use a library in the MY_Loader-Class - by El Forum - 11-23-2013, 07:43 AM
How to use a library in the MY_Loader-Class - by El Forum - 11-23-2013, 11:42 AM
How to use a library in the MY_Loader-Class - by El Forum - 11-23-2013, 12:18 PM
How to use a library in the MY_Loader-Class - by El Forum - 11-23-2013, 01:07 PM
How to use a library in the MY_Loader-Class - by El Forum - 11-23-2013, 01:11 PM
How to use a library in the MY_Loader-Class - by El Forum - 11-23-2013, 01:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB