Welcome Guest, Not a member yet? Register   Sign In
Call a model from another model

Hello, i have a model called "I_Model" and I want to call another model called x_Model.
How do I?

Do not call another model from a model. that's not the mvc pattern thing. u just need to call a model in a controller.

Depending on the application you may want to have a model extend another model, there is absolutely nothing wrong with that in my opinion.

A classic example is having a base "product" model and from their having several models extending it, perhaps a "buy_product", a "sell_product", a "admin_panel_for_product", a "product_inventory", etc. Your "base" product model would contain all the universal "product" methods that the other child models need.

The above mentioned scenario is no different than having a "MY_Model", except it's on a bit more of a micro/specific scale.

Quote:How do I?
Have you tried looking for the answer on a search engine, this has been answered literally 100's of times already. Try this:

If you have any problems please next time post your code that is causing the problem and describe the error that you are getting.

Thanks, I solved the problem!

Theme © iAndrew 2016 - Forum software by © MyBB