Question about M-V-C

#1
[eluser]Unknown[/eluser]
Greeting . I'm New in this forum and in the codeigniter .. I learnt some basics in it but I need to know in details when use controller, the views and the models ?

#2
[eluser]Jason Hamilton-Mascioli[/eluser]
Have you tried all the tutorials? ... http://codeigniter.com/tutorials/

http://net.tutsplus.com/?s=codeigniter

etc...

#3
[eluser]obiron2[/eluser]
Broadly speaking:
if you need to show it to the user, then it goes in the view
If you need to get it from or send it to a database (or disk system, flat file, log record etc) then it goes in a model
Everything else goes in the controller.

Note that there are exceptions but if you start with the above, you will not go too far wrong.

It would have been better if the process had been called MCV. The Controller gets information from the Model and passes it to the View or gets information from the View (posted form) and passes it to the Model.


The most important thing to remember is that the controller should never output anything directly to the screen, nor should it read or write directly to a file.



Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.