Reputation: 1866
I have two folder in View Folder
Layout Folder :- in this folder I have create two files header.php and footer.php
Agent Folder :- In this folder iIhave Main file dashboard.php.
I want to include header and footer file from layout folder to Dashboard.php.
I am using this code:
<?php include('../layout/header.php') ?>
Upvotes: 2
Views: 4322
Reputation: 502
Folder structure
application/view/template
application/view/site
$this->load->view('template/header');
$this->load->view('site/dashboard');
$this->load->view('template/footer');
Upvotes: 1
Reputation: 123
Try this:
$this->load->view('layout/header');
$this->load->view('layout/footer');
In controller function just load using this code:
public function index()
{
$this->load->view('layout/header');
$this->load->view('agent/dashboard');
$this->load->view('layout/footer');
}
Upvotes: 1