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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:29:48+00:00 2026-05-30T21:29:48+00:00

Just tinkering around with MVC in PHP for the first time. I’m following a

  • 0

Just tinkering around with MVC in PHP for the first time. I’m following a simple tutorial where I’ve stumbled upon a problem which isn’t mentioned in the current tutorial: What is the correct way to include global files (such as header and footer) within the MVC principles if I want to include some special functions for each page (inside the header and/or footer)?

Say I’ve got a “log page” and a “home page” which both includes the footer.php. However on the “log page” I want some additional text in the footer (to keep it simple). Making separate files is one solution but that feels awkward and also breaks the MVC principle in my mind.

Another solution is perhaps to pass the $_REQUEST from the controller which determines what view should be loaded into the footer – but that again seems to break up the MVC as this, in my mind, is application logic?

The third solution which I’m starting to believe is the best (keep in mind I’m learning!) is to pass data from the model via the controller to the footer and header in the same way I do for page views, thus making header and footer views in their own.

  • 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-30T21:29:49+00:00Added an answer on May 30, 2026 at 9:29 pm

    What you need is called Layout in MVC and yes, it’s a view. Here is a relevant question with an answer: View in MVC, what is a layout and how to create one

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

Sidebar

Related Questions

I'm a PHP guy learning some .NET. I am tinkering around with the UpdatePanel
I've been tinkering around with PHP lately and wanted to make my own blog
So I've been tinkering with some code, which I kinda regret, originally the problem
I was just tinkering around with calling GetPrivateProfileString and GetPrivateProfileSection in kernel32 from .NET
I am completely new to Batch files and have been tinkering around with simple
Just started tinkering with Dart and I decided to write a simple Http Server
I just started tinkering with ASM and I'm not sure if my understanding of
Just wondering if the following is considered to be good programming practice or not?
Just looking for a good PHP Image Library, I want to display images with
I've been tinkering around with Zend-Framework and Jquery for a month or so, and

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.