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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:16:55+00:00 2026-06-01T07:16:55+00:00

So I have reached a certain point in the development of my app where

  • 0

So I have reached a certain point in the development of my app where having this folder structure:

views/
     includes/{header.php, template.php, footer.php}
     home.php
     xyz.php
     ... 

and loading the views this way

controller.php

    $data['lists'] = $lists;
    $data['view'] = 'home';
    $this->load->view('includes/template', $data);

template.php

<?php
    $this->lang->load('common');
    if($view == 'videoPage') 
    {
        $header['title']       = $data['title'].' - XYZ.com ';
        $header['description'] = $data['description'];
        $header['keywords']    = implode(', ',$data['tags']);
        $header['canonical']   = $data['canonical'];
        $this->load->view('includes/header', $header);
    }
    elseif (($view == "searchsPage") || ($view == 'tagsPage'))
    {
        $header['title'] = $query.' - XYZ.com ';
        $this->load->view('includes/header', $header);
    }
    else
    {
        $this->load->view('includes/header');
    }
?>
    <div role="container">
        <?php
            if ( ! empty($data))
            {
                $this->load->view($view, $data);
                if(($view == 'searchsPage') OR ($view == 'tagsPage')):
                ?>

                ...SPECIFIC CODE HERE...

                <?php endif;
            }
            else
            {
                $this->load->view($view);
            }
        ?>
    </div>
<?php $this->load->view('includes/footer'); ?>

and more…

Is starting to get a little bit messy, so I was wondering if is worth it to implement an existing templating library from http://getsparks.org/search (search for “template”) or just do some improving to the one I use? Any other ideas?

  • 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-06-01T07:16:56+00:00Added an answer on June 1, 2026 at 7:16 am

    I also started implementing library on my own but after a while it got messy and then changed to existing one. Specifically I used Phil Sturgeon’s Library and it’s a good one. The link to the library http://getsparks.org/packages/template/versions/HEAD/show.
    Hope this helps.

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

Sidebar

Related Questions

I am starting to build my first Android app. I have reached the point
My team (4 people) have just reached a major milestone in our development, putting
I have been struggling with this question for awhile now, and I haven't reached
I am certain I have done something wrong to make this happen. I am
While working with macros, I have reached the point (I have been trying hard
I am working with System.Func but have reached a stumbling block with it. System.Func<TReturn>
Hi I have been trying to learn Javascript using codeacademy.com and I have reached
I am developing an application with the MVVM model, but I have reached a
I have a table where I should count if an user has reached a
I have a page which has many event handlers. The code now reached 1000+

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.