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

  • Home
  • SEARCH
  • 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 6137127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:41:15+00:00 2026-05-23T17:41:15+00:00

I need help clarifying the correct structure and process flow for an MVC application

  • 0

I need help clarifying the correct structure and process flow for an MVC application in PHP.

I think I’ve got the concept round the wrong way because currently most of my processing is done (or at least initiated by) the Views. — I kind of inherited this way of thinking from the company I’m working for, but now I’m not sure that they are understanding the MVC model correctly!

Having looked at it again I think that the proccess should be as follows (very basicly):

  • The users actions are sent to the Controller
  • The Controller process those actions using any Models required
  • The Controller then instantiates the relevent View and passes the required data to it
  • The View renders the page to the user

I’m also having some difficulty deciding wether the view should even have any real functionality in it or not.

i.e. Is it just a wrapper to hold the page data and load the required template files (header, page, footer etc.), OR should any functions to do with rendering data (i.e. preparing HTML and outputting HTML) be in the View?


Another question is does the controller ‘hand over’ to the model and have nothing to do with the actual DBconn (so that the Model acts like a Bouncer on the doors of the DB nightclub, and we’re not on the list) OR does the controller ‘own’ the DBconn and simply lends it to a model when it needs it?

I’d really appreciate any help and advice anyone can offer.

Thanks

edit — I found this helpful!

  • 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-23T17:41:15+00:00Added an answer on May 23, 2026 at 5:41 pm

    I’ll answyer to your two last questions:

    1) The Views should have basic output capabilities, for example escaping values to avoid security issues or display a html table starting from a list of objects. Another responsibility could be the translation of labels and other constant values (for example you could have $this->_(‘Your label’) where function _($val) is a function included in all your view classes that translates the strings starting from a csv file).

    2) Depending on the complexity application, you could have two sub-layers in the model layer. The upper layer is the classic model with the functionality of your entities. The lower level is the resource model class associated that performs the db operations. You could also have a single layer with your models that implements the DAO pattern. Anyway, the controller shouldn’t have nothing to do with db connection.

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

Sidebar

Related Questions

Need help reworking this php code/logic. Right now, if I have no value for
Hey Guys. I need help understanding my hw assignment. I am starting out in
Need help finding or having a RegEx match a MM/YY or MM/YYYY format. My
Need help handling errors while running a merge statement. How do I make the
Need help in date conversion: Existing date format: Wed, 01 Dec 2010 00:00:00 -0500
Need help transfer sql to sequel: SQL: SELECT table_t.curr_id FROM table_t INNER JOIN table_c
Need help with a simple NHibernate relationship... Tables/Classes Request ------- RequestId Title … Keywords
Need help with Visual Studio 2010. My problem: I have millions <%: Resources.A.B %>
Please I would like your help with the following issue: This is a sample
Given a DateRange I need to return a list of Start and EndDates that

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.