Welcome Guest, Not a member yet? Register   Sign In
model renamed
#1

[eluser]jorgeakanieves[/eluser]
I´ve created a modular library class structure. When I load a library from a controller, it creates a model object(in CI object) on constructor but if call another library from the controller again, it load another model object and rename the model created before (I call all models with the same name "base" for an abstract coded).

Code:
//I run the controller admin.php
//it loads a library
$this->load->library('Users');

//Users library creates a model object called "base":
$this->module = "perfiles";
$this->CI=& get_instance();

// load its model
$this->CI->load->model($this->modulo,"m".$this->modulo, "base");
// start model constructor
$this->CI->base->__construct();

// return to controller and loads another library
// the library creates another model object called "base" and
// rename before model
What could I do?
#2

[eluser]jorgeakanieves[/eluser]
anybody helps me?




Theme © iAndrew 2016 - Forum software by © MyBB