[eluser]mmarcus44[/eluser]
Well the goal is to be able to use a function within a library from any other controller by extending the main controller, not loading the super object into a variable then using that object.
I think this is actually more organized. Should I not be able to use a function that has all the resources from any of my main controllers?
example:
I have 2 controllers admin.php and user.php..... im running a function in admin.php that would want to use a function from user.php... I can't just load the user object into my admin object, I have to load a library that can then run that specific function that can be shared..... but I cant do that either becuase I have to load the entire CI super object first and use $ci->function() rather than $this->function().
I want to be able to EXTEND the main controller, why is this disoragnized?
Can I just load the super object into the library and then in the library constructor I can just pick apart the resources I want from the main controller and reassign them all over again?
Like this:
Code:
class Library{
var $db;
var $load;
var $encrypt;
function Library(){
$ci =& get_instance();
$this->db = $ci->db;
$this->load = $ci->load;
$this->encrypt = $ci->encrypt;
}
}