Multiple models in 1 variable - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Multiple models in 1 variable (/showthread.php?tid=54074) |
Multiple models in 1 variable - El Forum - 08-21-2012 [eluser]Unknown[/eluser] I got this problem i need to load a model dynamically like this Code: $this->load->model($fila_destino->nombre,'tabla_temp'); An example. i need to load in the first time the model "model1" and load in 'tabla_temp' and the second time to "model2" and load to in "tabla_temp" but, the second time the model "model2" doesn't load on 'tabla_temp' besides 'tabla_temp' it's an instance of "model1". Multiple models in 1 variable - El Forum - 08-21-2012 [eluser]TWP Marketing[/eluser] [quote author="Ernesto2456" date="1345570527"]I got this problem i need to load a model dynamically like this Code: $this->load->model($fila_destino->nombre,'tabla_temp'); An example. i need to load in the first time the model "model1" and load in 'tabla_temp' and the second time to "model2" and load to in "tabla_temp" but, the second time the model "model2" doesn't load on 'tabla_temp' besides 'tabla_temp' it's an instance of "model1". [/quote] Does your variable: Code: $fila_destino->nombre Is it capitalized as in 'Model1' or 'Model2' which I think are the class names of your model classes. Multiple models in 1 variable - El Forum - 08-21-2012 [eluser]Unknown[/eluser] Yes, the variable Code: $fila_destino->nombre Code: $fila_destino->nombre i tried with Code: $this->tabla_temp=null; Code: unset($this->tabla_temp); |