Welcome Guest, Not a member yet? Register   Sign In
Extending CI_Controller / Indirect modification of overloaded property
#7

[eluser]Abdul Malik Ikhsan[/eluser]
not like that, for example like this :

Code:
class MY_Controller extends CI_Controller
{
    protected $ci;

    public function __construct()
    {
        $this->ci = & get_instance();
        $this->ci->testing = array('test'=>'testing 123');
    }
}
and in your disapther class :
Code:
class Dispatcher extends MY_Controller
{
    protected $ci;

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

    public function index()
    {
        print_r($this->ci->testing);
    }
}


Messages In This Thread
Extending CI_Controller / Indirect modification of overloaded property - by El Forum - 09-13-2012, 10:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB