Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 404315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:17:50+00:00 2026-05-12T17:17:50+00:00

I’m relatively well versed in designing websites. I mostly go for LAMP where I

  • 0

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.

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.

So here’s my question: 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?

Let’s take an example (not too elaborate, but enough to see if my thinking is valid):

Say we have a simple games website.
The sections would typically be something like: frontpage, games, forums, and about / disclaimers etc.

The controller classes 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 frontpage, games-overview, gamepage, forums, forum, topic-page, about, and disclaimer.

The views 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.

The model (or dataobjects) 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.

Is the above “correct” way of thinking or am I totally misunderstanding the whole M-V-C concept for websites.

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.

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).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:17:50+00:00Added an answer on May 12, 2026 at 5:17 pm

    First of all, this is not a php specific question but rather a question about how to apply the MVC pattern to web programming. And indeed the MVC pattern makes so much sense in the area of web application development that it has almost become an imperative in this field of application.

    Now, as for the MVC pattern itself, you will find very good answers on SO already. For example the Question and Answers of What goes into the controller.

    As for the question of how to map your website structure to your controller architecture I would recommend the following.

    • don’t try to map your navigation but rather the application logics
    • one controller for each logical unit of functions
    • inside the controllers, one public method for each view
    • rather lean controllers which mainly play gateway between models and views

    So for example if in your case gameoverview is just a list, it doesn’t need its own controller but rather is just a method in the indexcontroller that gets the list from the model and sends it to the respective view. But if your gameoverview is a complex mechanism with many possibilities and different subviews, etc. you could have an overviewController with several methods for the different views and tasks.

    I really recommend looking into Zend Framework and how these problems are solved there. IMO you can learn really a lot about the topic of your question by doing that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small JavaScript validation script that validates inputs based on Regex. I
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an array which has BIG numbers and small numbers in it. I
I have a reasonable size flat file database of text documents mostly saved in
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.