porting i18n library to 2.0 - CI_Controller not found - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: porting i18n library to 2.0 - CI_Controller not found (/showthread.php?tid=40655) |
porting i18n library to 2.0 - CI_Controller not found - El Forum - 04-15-2011 [eluser]froginvasion[/eluser] On the IRC channel, somebody gave me the hint that it might be a version error, but well.. I don't know. It concerns the following library: http://codeigniter.com/wiki/CodeIgniter_2.1_internationalization_i18n/ With some minor bugfixing, the code does what's expected and prescribed. But this is not exactly what I want to have. I was trying to modify the code so it does what I want. For that I tried getting an instance of $CI in function MY_lang(), just after the construct. Code: function MY_Lang() this gives the following error: Quote:Fatal error: Class 'CI_Controller' not found in /**myproject**/system/core/CodeIgniter.php on line 210 Anyone got an idea what I'm doing wrong? If you look in the code of the extension, you can see that a CI instance is being retrieved in another function, and that never fails. However... that function is never used. porting i18n library to 2.0 - CI_Controller not found - El Forum - 04-15-2011 [eluser]InsiteFX[/eluser] Add this at the bottom of your config.php file - application/config/config.php Code: /* InsiteFX porting i18n library to 2.0 - CI_Controller not found - El Forum - 04-15-2011 [eluser]froginvasion[/eluser] I already found the answer; I already added that piece of code actually. I am trying to do "$CI =& get_instance();" before the __construct(), is finished. Someone helped me debugging, and it seems that the Controller class is not yet loaded, so that's why the call fails on : CI_Controller::get_instance() porting i18n library to 2.0 - CI_Controller not found - El Forum - 04-15-2011 [eluser]InsiteFX[/eluser] CodeIgniter User Guide Hooks! InsiteFX |