Wednesday, February 2, 2011

CodeIgniter - Library class not found when upgrading to CI 2.0

If you have recently upgraded your CodeIgniter framework to their recent 2.0 release, you have have run into some issues, that were not covered in the upgrade guide or in the user manual. A specific error I ran into was a file not found when a controller was looking for it's parent class. The parent class happened to be a general Controller file that extended the CI native Controller class (now should be CI_Controller with 2.0). The class I had written called MY_Controller could not be found.

After looking around online I finally found the solution. What was failed to be mentioned in the documentation was that your extending class files should be moved from the 'libraries' folder to the new 'core' folder. This solves the issue.

Thanks for this thread for revealing the solution.

No comments: