i18n library in CI2 |
[eluser]Razican[/eluser]
I have been using this library in CI2 until last update. http://maestric.com/doc/php/codeigniter_i18n The problem is that since that update, I have changed the code to look like this: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); I get this error: Fatal error: Class 'CI_Controller' not found in /system/core/CodeIgniter.php on line 210 How can I solve it?
[eluser]WanWizard[/eluser]
That has nothing to do with this library. Your controllers are still extending 'Controller' instead of 'CI_Controller'. You should also change all controller constructors to __construct() instead of using the class name.
[eluser]Razican[/eluser]
This is my controller structure: Code: class Main extends CI_Controller {
[eluser]developer10[/eluser]
[quote author="Razican" date="1289618137"]I have been using this library in CI2 until last update. http://maestric.com/doc/php/codeigniter_i18n The problem is that since that update, I have changed the code to look like this: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); I get this error: Fatal error: Class 'CI_Controller' not found in /system/core/CodeIgniter.php on line 210 How can I solve it?[/quote] it is obvious what the error is saying: why dont you try to lookup the file itself where it is supposed to be. If it's in your files, then locate it in your localhost root and make sure it is named correctly. That's what i would do if i had the same problem
[eluser]InsiteFX[/eluser]
Did you change the CodeIgniter prefix ? Did you copy your Classes to application/core ? InsiteFX
[eluser]Razican[/eluser]
[quote author="InsiteFX" date="1289699457"]Did you change the CodeIgniter prefix ? Did you copy your Classes to application/core ? [/quote] I changed the $config['subclass_prefix'] = 'MP_'; I have the MP_Lang.php in /application/core/ It worked fine with the old version of CI2.
[eluser]n0xie[/eluser]
The problem is that in the latest CI2.0 build the get_instance() is a wrapper for CI_Controller::get_instance(), a static call to the (new) CI superobject instance. The i18n library does the call before the instance is created. This wasn't a problem before since get_instance() only existed if the CI_Base object was created, but since CI_Base is gone and 'replaced' by CI_Controller, the call is now done before instantiating the object. tl;dr: new PHP4 drop screwed up loading order of things for i18n library You can simply fix it by editing your MY_Config, which is part of the i18n library: Code: class MY_Config extends CI_Config {
|
Welcome Guest, Not a member yet? Register Sign In |