View Single Post
  #4 (permalink)  
Old 06-04-2008, 05:40 AM
Kalyse Kalyse is offline
Junior Member
 
Join Date: Jun 2008
Posts: 18
Default

Im also relatively new to the MVC architecture since I have developed all my applications as a single project I have never needed to.
However, isn't the whole idea behind MVC that you only have a single controller. (Please do correct me if I am wrong, I would hate to misdirect people and would like to be corrected).
You should never have more then one controller.

The controller should handle the users request to decide what to do. It handles the initial logic. The way I think of it is just to figure out what page the user wants it directs the user along the right path.
Once you know what page you want, you can use the model to grab any information from the database and then the controller can handle the logic again and pass on the load to the view.

You shouldn't do reading in a database from controllers if you are going to output it. You can do logic reading I GUESS?? (correct me) ie if you are checking which site to load (if your database contains 1000s of sites (like bebo??)).

Let me know if this is the correct approach.
Reply With Quote