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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:21:40+00:00 2026-05-23T22:21:40+00:00

my question is about whether what I’m doing is proper , or if it

  • 0

my question is about whether what I’m doing is proper , or if it causes security / performance issues.

Im using the $GLOBALS array , and filling it with a lot of values from the database, such as (page title, user information, template information … etc) so that all my php files have access to this info. Im following the MVC design pattern, so this is how my View files have access to the information generated in the Model files.

If this is not the proper way to do things, please tell me why, and what is the proper way.

Thank you

  • 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-23T22:21:41+00:00Added an answer on May 23, 2026 at 10:21 pm

    You’re is not following the MVC pattern, you are just using global variables to display something in a “shared all”-script in a “shared nothing”-architecture.

    Doing output can mean you get a view of something, but normally that is not to be mixed with the term View of the MVC (Model-View-Controller) pattern. What you do, templating or output is maybe a better wording.

    If this is not the proper way to do things, please tell me why, and what is the proper way.

    If you want to implement MVC pattern, than this might be the MVC you’re referring to:

    • Model: Your Filesystem and Database
    • View: Your HTML output + CSS + JS
    • Controller: Your PHP Script

    MVC is just a pattern. You can implement it like you feel good. And you can find it in lot of stuff that has implemented nothing. It’s just a pattern.

    But more precisely the MVC pattern is more commonly seen for an object oriented implementation of it. Your implementation is totally different to such of a object oriented one, you’re using global state instead of object instances.

    But you have not written in your question that you thought about implementing an object oriented MVC pattern and that templating script you use is part of it.

    It can be perfectly proper to do it like you do it depending on the needs to fulfil.

    MVC is just a pattern. It has pro’s and con’s. It has benefits and it has consequences. It’s just a pattern.

    Especially if you’re concerned about performance don’t make things more complicated as they need to be, e.g. loading a full blown object tree to just display some variables inside a HTML template.

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

Sidebar

Related Questions

I saw this question asking about whether globals are bad . As I thought
On a recent question about MVC attributes, someone asked whether using HttpPost and HttpDelete
this is a fairly general question about whether people should be using brackets on
A question was asked about whether namespace and folder structure would affect performance of
I have a question about whether or not a specific way of applying of
I just posted a question about whether WPF is a good choice for a
I was going to ask a question here about whether or not my design
Simple question: Office debate about whether the keyword AS is necessary in our T-SQL
My question might get closed, but I'm curious about whether it's always required to
This is a question about using an object-oriented language. I've been using C++ to

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.