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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:36:01+00:00 2026-05-24T16:36:01+00:00

Well with my CMS I am building I was able to purchase a really

  • 0

Well with my CMS I am building I was able to purchase a really nice admin template from theme forest and I’m trying to figure out how to accomplish the themeing/templating.

Login Page Here: http://www.kansasoutlawwrestling.com/admintemp/login.html

Control Panel: http://www.kansasoutlawwrestling.com/admintemp/index.html

Now most of the files are the same however I’m going to be using the Tank Auth library for my user login and authentication which includes the registration and forgot password form, etc.
I want to be able to use the same layout, template, theme whatever is the proper term for those authenitcation forms because if you notice on the login page there’s a body class of login which complicates things a little.

Or is there a better way to accomplish this without a templating library or even is there a better library that I should use?

Anybody have any ideas?

Newest Code:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {

/**
 * Index Page for this controller.
 *
 * Maps to the following URL
 *      http://example.com/index.php/welcome
 *  - or -  
 *      http://example.com/index.php/welcome/index
 *  - or -
 * Since this controller is set as the default controller in 
 * config/routes.php, it's displayed at http://example.com/
 *
 * So any other public methods not prefixed with an underscore will
 * map to /index.php/welcome/<method_name>
 * @see http://codeigniter.com/user_guide/general/urls.html
 */

public function __construct()
{
    parent::__construct();
    $this->load->helper('url');
    $this->load->library('tank_auth');
}


public function index()
{
    // Set up the template. 
    $this->template->set_layout('default')->enable_parser(false);

    if (!$this->tank_auth->is_logged_in()) {
        redirect('/auth/login/');
    } else {
        $data['user_id']    = $this->tank_auth->get_user_id();
        $data['username']   = $this->tank_auth->get_username();
        $this->load->view('welcome', $data);
    }


}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */

FIXED THIS ISSUE

  • 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-24T16:36:02+00:00Added an answer on May 24, 2026 at 4:36 pm

    One of the most basic ways of templating a site in CodeIgniter is to create a template or “layout” php file that dynamically loads another view file.

    Try something like this and see if it works for you:

    views/layout.php

    <html><body>
    <?php $this->load->view('header.php'); ?>
    <?php $this->load->view($component); ?>
    <?php $this->load->view('footer.php'); ?>
    </body></html>
    

    views/header.php

    <h1>Header</h1>
    

    views/footer.php

    <h6>Footer</h6>
    

    views/login.php

    <p>Login here!</p>
    

    controllers/welcome.php

    public function index() {
        $data['component'] = "login";
        $this->load->view("layout", $data);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the N2 CMS system for ASP.NET. Well I say 'using', I'm really
I am building a PHP CMS from the ground up. There is one super-core
I'm working on a PHP CMS like project and I'm trying to find out
I'm trying to learn CakePHP by building a simple CMS app, it was going
I am trying to get mail working from Orchard CMS . I run IIS
I'm using nicEdit but it doesn't play well with our CMS. I need to
Well, my website can not redirect to https://www.facebook.com/QuaFootSpa from http://quafootspa.com/ I have tried redirection
Well, the title pretty much states it. I want to be able to draw
Well, i took a break from RoR for studies, now I am back, I
well, I am trying to include a header file in my project, while the

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.