![]() |
I can't extend the Exceptions class . - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: I can't extend the Exceptions class . (/showthread.php?tid=22797) |
I can't extend the Exceptions class . - El Forum - 09-20-2009 [eluser]Twisted1919[/eluser] Hi there , i don't know if i'm doing this in the right way , but here is my situation . I have MY_Controller , which in its constructor checks if the site is online or under maintenance , as follows : Code: class MY_Controller extends Controller{ Ok , now i thought that if i cand duplicate the show_error() function and change it a bit would feet my needs , so i tried to extend the Exceptions class as follows: Code: class MY_Exceptions extends CI_Exceptions{ Fatal error: Class 'CI_Exceptions' not found in C:\wamp\www\ci\system\application\libraries\MY_Exceptions.php on line 8 So why this isn't working ? I ended up by doing Code: class MY_Controller extends Controller{ How correct is that ? Any suggestions on doing this in the right way ? Thank you . I can't extend the Exceptions class . - El Forum - 09-21-2009 [eluser]überfuzz[/eluser] My suggestion is that we should start looking at the error-message. Code: Fatal error: Class ‘CI_Exceptions’ not found in C:\wamp\www\ci\system\application\libraries\MY_Exceptions.php on line 8 I can't extend the Exceptions class . - El Forum - 09-21-2009 [eluser]wiredesignz[/eluser] @Twisted1919, Using the load_class() method is perfectly acceptable if you need to load your extension of a core library. I can't extend the Exceptions class . - El Forum - 09-21-2009 [eluser]Twisted1919[/eluser] @uberfuzz - Actually the class filename is Exceptions.php , and yes it's there . @wiredesignz - Thank you , i got it sorted out without extending the exceptions class . |