Load a model in a Codeigniter library

Posted by ci on Stack Overflow See other posts from Stack Overflow or by ci
Published on 2010-04-06T16:38:52Z Indexed on 2010/04/06 16:43 UTC
Read the original article Hit count: 204

Filed under:
|
|

Hello, people!

I have this piece of code:

class MY_Language extends CI_Language {

   function MY_Language()
   {
       parent::CI_Language();        

       $CI =& get_instance();

       $CI->load->model('language_model');

       $languages = $this->language_model->get_languages();

       print_r($languages);
   }

}

But I keep getting "Fatal error: Call to undefined function get_instance() in C:\xampp\htdocs\application\libraries\MY_Language.php on line 44". Any ideas? Thanks in advance!

© Stack Overflow or respective owner

Related posts about codeigniter

Related posts about model