Welcome Guest, Not a member yet? Register   Sign In
Multiple models in 1 variable
#2

[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');
$data2=$this->tabla_temp->loggin($data->idusuario);
being $fila_destino->nombre, the name of the model to charge, but when i call the function loggin of tabla temp (the second line of the code), it's always charge the first model (the bug occurs when the $fila_destino->nombre it's different than the first time it's called.
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
contain a valid model name?
Is it capitalized as in 'Model1' or 'Model2' which I think are the class names of your model classes.


Messages In This Thread
Multiple models in 1 variable - by El Forum - 08-21-2012, 10:35 AM
Multiple models in 1 variable - by El Forum - 08-21-2012, 12:11 PM
Multiple models in 1 variable - by El Forum - 08-21-2012, 12:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB