Welcome Guest, Not a member yet? Register   Sign In
Error on $ci =& get_instance();
#1

[eluser]PermanaJ[/eluser]
I got error on line '$ci =& get_instance();'

the error message is
Quote:Fatal error: Call to undefined function get_instance()

Anybody know how to solve the error? I want to extends Language class so it load language base on cookie

Code:
class MY_Language extends CI_Language{
    
    function MY_Language() {
        parent::CI_Language();
        
        $ci =& get_instance();
        $language = get_cookie('language');
        if( $language ){
            $ci->config->set_item('language',$language);
        }else{
            set_cookie('language', $ci->config->item('language'), 1447);
        }
        $ci->lang->load('myword', $ci->config->item('language'));

    }
}


Messages In This Thread
Error on $ci =& get_instance(); - by El Forum - 03-14-2009, 07:59 AM
Error on $ci =& get_instance(); - by El Forum - 03-14-2009, 08:18 AM
Error on $ci =& get_instance(); - by El Forum - 03-14-2009, 08:47 AM
Error on $ci =& get_instance(); - by El Forum - 03-14-2009, 08:55 AM
Error on $ci =& get_instance(); - by El Forum - 03-14-2009, 10:13 AM
Error on $ci =& get_instance(); - by El Forum - 03-14-2009, 11:41 AM
Error on $ci =& get_instance(); - by El Forum - 03-14-2009, 08:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB