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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:28:04+00:00 2026-05-27T17:28:04+00:00

Hello first sorry if its a stupid question, but I amm a beginner, and

  • 0

Hello first sorry if its a stupid question, but I amm a beginner, and im a bit lost.

For practice I decided to code a really small social network just for practice.

I worked on small CodeIgniter projects in the past, and the truth is I dont really like loading the header and footer in every controller.

So on YouTube I saw a video about creating basic templating.

But I can’t really decide whether it is a good idea.

So how would it look like?

In my view folder I created 3 subfolders

- include 
- template
- user 

In the templates I have the main_template.php and that looks like this:

 <!DOCTYPE html>
 <html>
 <head>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="<?php base_url();?>themes/default/style.css">
    <title><?php echo $title; ?></title>
 </head>
 <body>

</body>
</html>

The controllers would contain different variables for the title and other stuff if needed for each view.

My question is: is it a bad idea not create header and footer files, and creating all views with including the html, head, and body tag like this?

  • 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-27T17:28:05+00:00Added an answer on May 27, 2026 at 5:28 pm

    I would recommend using a “header” and “footer”. Otherwise it’s going to get really messy when you’r trying to customize each template. I get passing down a few variables to the views; actually, that will come in really handy when setting the page’s title, meta description, JS/CSS includes, etc. However if you keep your header/footer together, you will have to either pass the entire body in a variable or pass in the name of the specific view you want; in which case you would have to load the specific view inside this main view.

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

Sidebar

Related Questions

First : Appologize for my bad english. Sorry for this newbie software question, but
I am following the Getting Started guide for wxPython. But unfortunately the first 'Hello
First off - hello, this is my first Stack Overflow question so I'll try
Hello this is may first question and I have found so far the following
First question here so hello everyone. The requirement I'm working on is a small
Question: Hello All, Sorry that this is kind of a noob question. I just
first,sorry for my bad English!! i'm new here and i'm a beginner of android
First of all Sorry for the really long post, now And this is my
first of all sorry by my bad english, Hello i am new in this
First of all hello people, and sorry for my bad English, I'm Brazillian! I've

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.