Welcome Guest, Not a member yet? Register   Sign In
Extending php Exception class... how to integrate into CI
#11

[eluser]Unknown[/eluser]
This is an old post, but in case this helps someone.

When extending core classes you need to place your file in the <b>application/core</b> directory; not in the libraries folder. See http://ellislab.com/codeigniter/user-gui...asses.html. Your extended class will not get called otherwise.

Also, I believe the below needs a constructor something closer to this:
Code:
public function __construct()
    {
        parent::__construct();
    }

Hopefully that helps.

[quote author="AtlantixMedia" date="1203957645"]I also need to extend the CI_Exceptions class.

I named it MY_Exceptions.php and put it in /applications/libraries/


Code:
&lt;?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

class MY_Exceptions extends CI_Exceptions{
    
    function MY_Exceptions(){
        parent::CI_Exceptions();
        
    }
...


however, functions in MY_Exceptions do not seem to be overridden at all. functions in Exceptions are the one which are run[/quote]




Theme © iAndrew 2016 - Forum software by © MyBB