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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:06:01+00:00 2026-05-13T10:06:01+00:00

I came to a point where I realized that I need an intelligent solution

  • 0

I came to a point where I realized that I need an intelligent solution for this problem.

In my framework, there are:

  • Views (actually just HTML files with little PHP to output data)
  • View Controllers (create views, do some logic)

So for every page like https://stackoverflow.com/questions/ask for example, I have an ViewController which is called by the framework. There’s an RootViewController which creates an layout view. The layout view specifies headers and footers, and the main structure of the site. It has a contentView placeholder, for instance.

With this design I specify the HEAD part only once, and so the DOCTYPE, TITLE and all the other stuff is sticked to that layout view template.

Every View Controller which loads that RootViewController can set the title, append an CSS inclusion or Javascript inclusion (which is one of those fancy link rel tags in the HEAD), just by calling some methods on the RootViewController.

So far, that’s actually pretty flexible, because if you don’t specify anything, you get useful defaults and an reasonable HEAD with everything needed.

But I see these problems:

  • Can’t I make life for the framework user more simple? The layout template must contain all this “garbage” that kills productivity. Why should a framework user even have to think about setting up a correct HEAD? It’s always the exact same problem, needs the exact same syntax, the exact same inclusions of CSS and Javascript of the framework, etc. …you get the point.

  • It would have to contain the exact corresponding placeholder variables to match the methods of the RootViewController.

So to solve this, I thought I could provide an fancy variable which can be inserted into any view template to output the HEAD block.

I just want to see what you think about this, and if my solution is just fine, or if I’m about to make a big design error here. And if so, what would be the alternatives?

  • 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-13T10:06:02+00:00Added an answer on May 13, 2026 at 10:06 am

    You could have your “user” specify only the body template, and automatically output your head, the “user’s” body, and your footer. Then the template designer doesn’t have to remember to include some arbitrary variable, and should you ever decide to change the way your header/footer are included, you won’t have to update every single template.

    You could also allow the template designer override this behavior by calling some function.

    This is probably ideal: 90% of the time, your framework would do the right thing without any sort of developer effort. Only in the 10% of cases where the user wants to do something else, must they go out of their way to make it happen via a function call.

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

Sidebar

Related Questions

While developing an app I came to a point when I realized that I
I'm working with MVC3 and Entity Framework but i came to a point where
Came across something like this today, and was wondering if there was an equivalent
I came accross this html multiple file upload tutorial: http://robertnyman.com/2010/12/16/utilizing-the-html5-file-api-to-choose-upload-preview-and-see-progress-for-multiple-files/ I'm new to web
While commenting on an answer in this other SO post , the point came
I was going through this link , where I came across a point Avoid
I was going through differences of Struts1 vs Struts2, and came across this point:
I was looking up the difference between the two classes and this point came
So I came to a point where I needed to create a custom query
I recently came across a question about sequence points in C++ at this site,

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.