Welcome Guest, Not a member yet? Register   Sign In
get_instance return null
#1

Hi friends.

I have started migrating some projects in CI2 to CI3 but it crashed in a simply thing.

if I create my extension core for Exceptions:

/application/core/MY_Exceptions.php:

<?php defined('BASEPATH') OR exit('No direct script access allowed');

class MY_Exceptions extends CI_Exceptions
{
    private $_ci;

    public function __construct()
    {
        parent::__construct();
        $this->_ci = &get_instance();
        
        var_dump($this->_ci);
    }
}

It returns NULL  all the time.

I am doing something simple wrong but I don't know what.

Any help?

echo 'Thanks';
Reply


Messages In This Thread
get_instance return null - by llobu - 11-25-2015, 07:48 AM
RE: get_instance return null - by InsiteFX - 11-25-2015, 09:26 AM
RE: get_instance return null - by llobu - 11-25-2015, 12:25 PM
RE: get_instance return null - by jvandemerwe - 11-25-2015, 02:38 PM
RE: get_instance return null - by Narf - 11-25-2015, 05:23 PM
RE: get_instance return null - by gastongr - 11-26-2015, 11:16 AM
RE: get_instance return null - by kenjis - 11-26-2015, 02:12 PM
RE: get_instance return null - by sv3tli0 - 11-27-2015, 02:06 AM
RE: get_instance return null - by gastongr - 11-27-2015, 09:58 AM
RE: get_instance return null - by kenjis - 11-27-2015, 03:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB