Welcome Guest, Not a member yet? Register   Sign In
Load one model from another...
#1

[eluser]enigmas[/eluser]
Hi Guys, is it possible to call one model from another?

When I try to load model from another (something like this):

Code:
$this->load->model('Mymodel');
$this->mymodel->mymethod();

it alerts that "mymethod" is unknown. Same code works fine from controller.

Is there any way to do this?

Regards
#2

[eluser]Phil Sturgeon[/eluser]
Code:
$ci =& get_instance();
$ci->load->model('Mymodel');
$ci->mymodel->mymethod();
#3

[eluser]enigmas[/eluser]
Thanks Phil! That's exactly what I wanted!! Thanks a LOT!
#4

[eluser]snortop[/eluser]
Weee thx for google seach.. just what i wanted to know to.. ^^




Theme © iAndrew 2016 - Forum software by © MyBB