Welcome Guest, Not a member yet? Register   Sign In
Calling Models and loopback?
#2

[eluser]danmontgomery[/eluser]
[quote author="bunal" date="1263953597"]Hi Igniters,

I have 2 model which are modelA and modelB

Sometimes because of the logic i may need to access methods of ModelA from ModelB and vica versa.

So i am loading the ModelB in the contructor of ModelA and load ModelA in the contructor of ModelB that causes loopback?

How to prevent this from being happening?[/quote]

Don't load them in the constructor, load them in the functions you need them

Code:
$ci =& get_instance();
$ci->load->model("modelA");
$ci->modelA->some_function();


Messages In This Thread
Calling Models and loopback? - by El Forum - 01-19-2010, 02:13 PM
Calling Models and loopback? - by El Forum - 01-19-2010, 02:58 PM
Calling Models and loopback? - by El Forum - 01-20-2010, 08:28 AM
Calling Models and loopback? - by El Forum - 01-21-2010, 01:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB