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 465871
In Process

The Archive Base Latest Questions

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

I’m sure that someone already posted this question; however, I would like to get

  • 0

I’m sure that someone already posted this question; however, I would like to get all kind of recommendations for MVC on PHP. I know there are many experts out there willing to share their knowledge with people who has doubts about their coding best practices.

  • How should you organize your Controller?
  • How should you organize your Model?
  • Should Controller call one Model Method and the Model call submethods or should controller call all Model Submethods?
  • etc.

Hope this helps someone out there (because it’ll help me for sure).

  • 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-12T23:25:17+00:00Added an answer on May 12, 2026 at 11:25 pm

    MVC is the most misunderstood design pattern. There is by definition one model.

    When an urban planner proposes a project, he designs one model for it. The separate entities that the model might be comprised of: buildings, streets, parks, are typically not represented by separate models: they are all facets of the single model.

    So in MVC, the model can be comprised of different entities, and that is probably the best word for it: entity, as in an entity represented by a database table. The model in MVC might even be something more abstract than is actually represented in code, but rather a conceptual umbrella for all of the data that the application might need to act upon.

    Considering this, if these entities have their own methods, notably methods that might correspond to the facets of CRUD (create, read, update, delete), they should not be exposed directly to the controller, it is too low a level of abstraction. These building blocks should be built up into a coarser grained interface, for instance you might delete a record but then return the list of records after the deletion. The controller just needs access to a coarser grained method that performs all of the above.

    Furthermore, to expose the methods of the entities directly to the controller, could cause the controllers to have to be rewritten, along with the entity classes, if there is a change for instance as to what ORM (object relational mapping) system is being used. The intermediate layer I’m suggesting also is a good place for exception handling, logging and any other such administrivia that needs tending to.

    The suggested layer of methods at a higher level of abstraction is sometimes referred to as the business delegate, or a “facade”, but this is what I actually consider the model. Hope this isn’t too theoretical, and is helpful to the OP or other readers.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have some data like this: 1 2 3 4 5 9 2 6
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.