CodeIgniter Forums
Can not extends core Exception.php - 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: Can not extends core Exception.php (/showthread.php?tid=51615)



Can not extends core Exception.php - El Forum - 05-10-2012

[eluser]xander9x[/eluser]
Hi, I'm trying to extend the Exception but always receive Fatal error: Call to undefined function. I tried to add function to both the system/core and application/core/MY_Exceptions.php. Both failed.

Code:
class MY_Exceptions extends CI_Exceptions
{

//                        function __construct()
//                        {
//                                                parent::__construct();
//                        }

                        public function foo()
                        {
                                                echo 'foo';
                        }


Code:
class Users extends CI_Controller
{

                        public function index()
                        {
                                                foo(); // not work
                                                show_error('bar'); // works

Thanks!


Can not extends core Exception.php - El Forum - 05-10-2012

[eluser]InsiteFX[/eluser]
Why are you posting this in two topics?



Can not extends core Exception.php - El Forum - 05-10-2012

[eluser]xander9x[/eluser]
I tried to delete it, but can't find the Delete button Sad sorry.