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

This morning, I was reading Steve Yegge's: When Polymorphism Fails , when I came
This question is about 64-bit Java apps in general, although I came upon it
I've been working with a rails form all day and I was just randomly
A recent talk about unordered_map in C++ made me realize that I should use
We have 10 Linux boxes that must run 100 different tasks each week. These
I'm working on my HW for computer architecture and I came across the following
In natural languages, we would say "some color is a primary color if the
I ran dotTrace on my application (which is having some issues). IntPtr System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr,
I might be missing something about the intended behavior of list extend, but why

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.