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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:25:51+00:00 2026-06-17T21:25:51+00:00

I am new in PHP and have read about MVC. Currently, I am not

  • 0

I am new in PHP and have read about MVC. Currently, I am not using any frameworks and will like to know how can I push data from the controller to the view.

Background:

  1. htmlForm1.php -> Get inputs and pass data to DoWork.php to process
  2. DoWork.php -> Do work and pass to htmlForm2.php to display
  3. htmlForm2.php -> Display results

I understand that I obtain the values (from htmlForm1.php) in DoWork.php through _GET. My question is how do I get the values (from DoWork.php) in htmlForm2.php?

I have thought of using session, but is this the only solution? I do not require this data to be persistent after htmlForm2.php

  • 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-06-17T21:25:52+00:00Added an answer on June 17, 2026 at 9:25 pm

    The only information, that controller should be pushing to the view instance, would be user input (and even then only in rare cases).

    Instead the views should be requesting information from model layer through the services. The controller is mostly responsible for changing the state of mode layer, based on user input. That also should be done through services.

    To accomplish this the controller and view must have access to the same model layer. This is usually done by injecting some sort of ServiceFactory in both instances. The factory then makes sure that every service is instantiated only once, without making the code dependent on global state.

    P.S.: The views are not dumb templates. They are classes which are responsible for UI logic in the application. They are what creates a response for a user, when MVC is used in context of Web.

    P.P.S.: Model is not a class or an object. It is one of two layers in MVC. The other layer is the presentation layer, where controller, views and tempaltes are. The model layer consists mostly of three major groups, each responsible for one specific aspect of the layer: application logic, domain/business logic and storage logic.

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

Sidebar

Related Questions

I'm new to PHP programming and have poor knowledge about it, but I want
New to PHP and MySQL, have heard amazing things about this website from Leo
I am new in PHP and don't have much knowledge about cookies. It seems
I have just read about http://marc.info/?l=php-internals&m=131031747409271&w=2 . I use mysql_query in all my php
I have recently read about how cursors should be avoided. Well, I would like
I'm new to PHP, I've read a lot of tutorials about cookies and sessions
I have worked with ASP.NET(C#, classic/MVC), Django(Python) and CI(php) but I am completely new
I know namespaces are new in PHP but have been around for a long
i am new in php i have a problem in my php code.please help
I'm quite new to php and have been reading Larry Ullman book to develop

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.