Welcome Guest, Not a member yet? Register   Sign In
Using model in a model
#18

[eluser]oribani[/eluser]
[quote author="oribani" date="1253578351"][quote author="BrianDHall" date="1253571137"]@oribani - The only thing I don't understand is how CI is limited, limiting, or fails in some way to support inter-model communication? People incorrectly refer to get_instance() as a hack - it's a very useful, and necessary, feature for any OOP-style framework like CI.
[/quote]

You're right, but it's just that it would be nice to be able to do the same thing you do in a controller:

$this->load->model('foo');

Having the extra code suggested at the top of this thread seems a little unnecessary and thus "hackish". That's why I abstracted it into a helper so the model load is a one-liner, which is more clean. Code that is specific to the underlaying CI framework is best hidden away if possible IMO.
[/quote]

I'd like to add that although CI doesn't PREVENT you from doing things like this, it doesn't prevent you from doing much of anything - it's just PHP, after all.

However, there's a difference between that and SUPPORT. As I hope most people will agree (per most latter posts on this thread), inter-model communication is a good and necessary thing. CI should SUPPORT that as encouraged, good practice. It should be achievable without a hack IMO.

:-)


Messages In This Thread
Using model in a model - by El Forum - 01-25-2008, 03:09 AM
Using model in a model - by El Forum - 01-25-2008, 03:32 AM
Using model in a model - by El Forum - 01-25-2008, 03:32 AM
Using model in a model - by El Forum - 01-25-2008, 03:40 AM
Using model in a model - by El Forum - 01-25-2008, 03:49 AM
Using model in a model - by El Forum - 01-25-2008, 03:52 AM
Using model in a model - by El Forum - 01-25-2008, 03:56 AM
Using model in a model - by El Forum - 01-25-2008, 11:37 AM
Using model in a model - by El Forum - 01-25-2008, 03:33 PM
Using model in a model - by El Forum - 01-25-2008, 04:07 PM
Using model in a model - by El Forum - 01-25-2008, 04:22 PM
Using model in a model - by El Forum - 01-25-2008, 07:44 PM
Using model in a model - by El Forum - 09-20-2009, 09:20 PM
Using model in a model - by El Forum - 09-20-2009, 09:43 PM
Using model in a model - by El Forum - 09-21-2009, 10:53 AM
Using model in a model - by El Forum - 09-21-2009, 11:12 AM
Using model in a model - by El Forum - 09-21-2009, 01:12 PM
Using model in a model - by El Forum - 09-22-2009, 07:24 PM
Using model in a model - by El Forum - 10-03-2009, 02:09 PM
Using model in a model - by El Forum - 05-21-2013, 09:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB