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

The Archive Base Latest Questions

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

I have seen all types of tutorials: View running controller, controller passing model to

  • 0

I have seen all types of tutorials:
View running controller, controller passing model to the view, controller setting setter of view.

An example: MVC for a reading of a news.
The controller loads the Model. If the result of the model is ‘false’ I can call another method from another model containing different block.

The View class must be relevant to, View_found View_not_found?

if (model-> news === true) {
      $ comment = model-> comment ()
}

Would this code snippet be the responsibility of the controller or is it a rule that such logic should belong to business model?

  • 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-30T17:50:37+00:00Added an answer on May 30, 2026 at 5:50 pm

    in my experience, i tend to program the model and view as “blind”. the model and view only receives parameters needed and then spits out what is needed. they should do minimal to no logic at all.

    for the model it performs minor checks, like parameter type and validity and returns either a result or false. the controller does not know how the data is stored, where, why etc.

    for the view, it should receive a string preferably through only one entry point, a function which will do the escape and echo. other than that, the controller should never echo to a page.

    everything else is for the controller to digest like validation, calling what’s needed, determine what is what. the controller sees everything:

    //get from model, pass parameter - that's it
    if (model-> news ('all')) {
        //manipulate data for result
        //get appropriate view
        view->parse(html); //pass html to view, that's it
    } else {
        //manipulate data for no result
        //get appropriate view
        view->parse(html); //pass html to view, that's it
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All the tutorials I have seen seem to use *.jsf , *.faces , or
All of the tutorials I've seen so far for RoR have shown me generating
Seen a lot of tutorials with all different types of layout, but not clear
I have seen posts all over the internet that talk about how to fix
We have all seen countless instances of forms with a select drop down having
Anyone using WPF for real LOB applications? We have all seen the clever demos
All the examples I have seen where the PropertyPlaceHolderConfigurer is used seem to be
I have seen on many sites the silverlight video player. I noticed that all
In Visual Studio, we've all had baadf00d, have seen seen CC and CD when
I'm sure you've all seen them. Line of Business UIs that have logic such

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.