Welcome Guest, Not a member yet? Register   Sign In
Models in CI are confusing to me
#2

[eluser]WanWizard[/eluser]
There are basically two approaches to using Models.

One is to use the model class to encapsulate a data object, so every instance of the model represents a distinct piece of data (for example a database record). This is what you do in your Java code, and how most ORM implementations use the model.

In CodeIgniter however, the Model is just an abstraction class, to keep your controller code clean and simplify interaction with whatever datasource you want to access. In that sense it is basically the same as a library. A CI model is loaded as a singleton.

I suggest you check out one of the ORM solutions available for CI, if you want to use data objects.


Messages In This Thread
Models in CI are confusing to me - by El Forum - 02-09-2011, 03:10 PM
Models in CI are confusing to me - by El Forum - 02-09-2011, 03:36 PM
Models in CI are confusing to me - by El Forum - 02-09-2011, 04:59 PM
Models in CI are confusing to me - by El Forum - 02-10-2011, 04:08 AM
Models in CI are confusing to me - by El Forum - 02-10-2011, 06:17 AM
Models in CI are confusing to me - by El Forum - 02-10-2011, 02:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB