I am trying to load a custom exception class that I created according to the instructions here:
http://codeigniter.com/user_guide/general/core_classes.html
MY_Exceptions.php is stored at application/core/
Somehow, when I try loading it, I keep getting this error:
Fatal error: Class ‘MY_Exceptions’ not found in C:\xampp\htdocs\xampp\facebook\application\models\campaign_model.php on line 29
Based on the instructions, it doesn’t say I have to autoload the class or anything. What am I doing wrong?
Name the class and file
MY_Exceptionswith an sYou do not need to autoload or manually load anything in the
coredirectory, nor should you. They are required classes for CI to run that are automatically loaded.For creating core classes, use this documentation instead: http://codeigniter.com/user_guide/general/core_classes.html
Keep in mind that when calling the class you will use the original class name. Let’s say you have created
MY_Input. Example:To understand the why and how, see
system/core/Common.phpfunctionload_class.Looking at the docs now, I agree that this should probably be highlighted.