Welcome Guest, Not a member yet? Register   Sign In
Loading a model in another model
#1

[eluser]Unknown[/eluser]
OK, I'm assuming you can do this but I can't get it to work.

I have Model_a that gets product information.
I have Model_b that gets shipping information.

I want to call a function from model_b into model_a

When I do something like this...
Code:
$this->load->model('Model_b');
$options = $this->Model_b->get_shipping_options();
I get this error message "Fatal error: Call to a member function get_shipping_options() on a non-object ."

Any ideas?
I've tried auto-loading the module(s) but that didn't help.

I know I'm calling the models correctly because I can do it from the controller.

Also, I had a real issue getting the db connection working in my models... I had to set a variable as the db connection in the constructor.

Any help would be great.
Dave


Messages In This Thread
Loading a model in another model - by El Forum - 08-17-2010, 12:38 PM
Loading a model in another model - by El Forum - 08-17-2010, 12:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB