Welcome Guest, Not a member yet? Register   Sign In
Models for dummies
#1

[eluser]Unknown[/eluser]
I am trying to figure out how to use MVC technique properly, but the Models section of the CI Users Guide is next to useless, and there are no video tutorials that explain how to use models. Could someone please show us novices how to start off on the right foot and properly separate our code into the M, V, and C portions? I need to know how to build a basic model, how to connect it to the database, and what type of functions/methods should go in the model. Thanks. This is stopping me from using CodeIgniter altogether until I can wrap my head around it.
#2

[eluser]Developer13[/eluser]
[quote author="Peter Hebert" date="1232946678"]I am trying to figure out how to use MVC technique properly, but the Models section of the CI Users Guide is next to useless, and there are no video tutorials that explain how to use models. Could someone please show us novices how to start off on the right foot and properly separate our code into the M, V, and C portions? I need to know how to build a basic model, how to connect it to the database, and what type of functions/methods should go in the model. Thanks. This is stopping me from using CodeIgniter altogether until I can wrap my head around it.[/quote]

You're one of the first that I've seen to declare any part of the documentation in the user guide, most specifically on models, useless. Regarding most of your concern about how to connect to your database, functions and methods, etc... sorry, but it is all covered in the user guide.

1. The Model is responsible for maintaining state between HTTP requests.

2. The Model incorporates all the rules, restraints and behaviour governing and utilising this information.

Also check out the Models 101 link in my signature. It might help you understand one way of using them in CI.




Theme © iAndrew 2016 - Forum software by © MyBB