title: PHP MVC - How to design?
body: <p>I'm relatively well versed in designing websites. I mostly go for LAMP where I already have a small "framework" of my own, that I use. In short, it separates the logic from the layout and I have basically one logic file to one or many layout files depending on what views are supported in the layout. There's an admin section and there are user auth and all such stuff. Fine.</p>
  
  <p>So, when looking to get more elaborate in my way of designing / programming in PHP - or website programming at large - I'm wondering how to "think" MVC properly. I'm leaning towards this way since my current framework is very DB oriented and has become somewhat heavy where performance is of the essence.</p>
  
  <p><strong>So here's my question:</strong> Am I correct in assuming that a controller typically corresponds to a "section" or "page" and a view takes care of displaying that controller, and that a model handles the objects used by the controller and being displayed in the views? </p>
  
  <p>Let's take an example (not too elaborate, but enough to see if my thinking is valid):</p>
  
  <p>Say we have a simple games website. 
  The sections would typically be something like: frontpage, games, forums, and about / disclaimers etc. </p>
  
  <p>The <strong>controller classes</strong> corresponds to the sections but gets a little more elaborate to cover the "single instance" version of the object covered by the section i.e. games section becomes two controllers; one for games overview (list of games) and one for the game page itself. The whole would be something like <em>frontpage, games-overview, gamepage, forums, forum, topic-page, about, and disclaimer</em>.</p>
  
  <p>The <strong>views</strong> can be a number of layouts for each controller e.g. the same as the controllers but perhaps various types of views on the forums pages (depending on how you want to view them) and games pages (maybe a highscore view) and so on.</p>
  
  <p>The <strong>model (or dataobjects)</strong> are typically users, games, forums, topics, posts, and then a lot of helper objects like topic tags, game highscores and what not to make the topics possible to categorize and the games able to have highscores etc etc.</p>
  
  <p>Is the above "correct" way of thinking or am I totally misunderstanding the whole M-V-C concept for websites.</p>
  
  <p>I'm thinking about moving over to CodeIgniter or some other light framework (feel free to comment on framework choice or if it is better to go for my own) since my own framework is very DB-oriented and is not cutting it now that a couple of my sites are surpassing 70,000 pageviews / day.</p>
  
  <p>A sincere thank you to those of you who can help in answer whether or not my take on MVC is somewhat correct and also if possible, add a few hints of what to think about when coding MVC and still want to maintain cutting edge performance (as much that is possible with scripted languages).</p>