Welcome Guest, Not a member yet? Register   Sign In
Loading sub controllers
#6

[eluser]Brandon Dickson[/eluser]
Louis,

The fact that MY_Controller extends Controller is really only semantics, I never actually call the parent constructor:
Code:
parent::Controller();
So MY_Controller isn't ever really part of the super object, instead, I create a generic super object with:

Code:
$this->ci =& new Controller();

I call get_instance() to make sure that a super object doesn't already exist.


Any time I access a property in a class that extends MY_Controller, if it can't find the property, it tries to get it from the super object. Thus $this->load is translated into $this->ci->load.

If it doesn't exists in the super object, is just throws the standards error.

Let me know if I've explained this well enough.

Thanks!
-Brandon


Messages In This Thread
Loading sub controllers - by El Forum - 06-03-2008, 08:31 AM
Loading sub controllers - by El Forum - 06-03-2008, 09:14 AM
Loading sub controllers - by El Forum - 06-03-2008, 09:18 AM
Loading sub controllers - by El Forum - 06-03-2008, 10:25 AM
Loading sub controllers - by El Forum - 06-03-2008, 10:28 AM
Loading sub controllers - by El Forum - 06-03-2008, 10:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB