Welcome Guest, Not a member yet? Register   Sign In
Why call parent constructor when creating a model?
#4

[eluser]@robertotra[/eluser]
Hi PhilTem,
we were writing at the same time... Smile
Thanks for enlightening !
Rob


[quote author="PhilTem" date="1327503068"]You ought to use the __construct method to have the magic __get method available throughout your model which works like this

[...]

That's actually the only thing why one uses the __construct-or (at least from my point of view). You can use the model as a pure library without extending the CI_Model, but then you'd have to write something like

[...]

which ain't no deal-breaker at all Wink But don't forget to keep yourself DRY Wink[/quote]


Messages In This Thread
Why call parent constructor when creating a model? - by El Forum - 01-25-2012, 07:26 AM
Why call parent constructor when creating a model? - by El Forum - 01-25-2012, 07:51 AM
Why call parent constructor when creating a model? - by El Forum - 01-25-2012, 07:57 AM
Why call parent constructor when creating a model? - by El Forum - 01-25-2012, 08:01 AM
Why call parent constructor when creating a model? - by El Forum - 01-26-2012, 12:34 AM
Why call parent constructor when creating a model? - by El Forum - 01-26-2012, 03:09 AM
Why call parent constructor when creating a model? - by El Forum - 01-26-2012, 03:27 AM
Why call parent constructor when creating a model? - by El Forum - 01-26-2012, 11:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB