[eluser]Mushex Antaranian[/eluser]
As I understand, you want to put sidebar in every page (or many pages) of your site and call it only once. Try to use this structure
Your views folder structure
views/index.php
views/header.php
views/footer.php
views/sidebar.php
views/some_page.php
where index.php is your master view and looks like this
Code:
<?php
//master view - index.php
$this->load->view('header');
$this->load->view($page);
$this->load->view('sidebar');
$this->load->view('footer')
?>
.. and your controller will look like this
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Some_controller extends Controller {
function Some_controller()
{
parent::Controller();
}
function index()
{
//put here view name you want load as main page
$page = 'some_page';
//put here any data to send to view
$data['page'] = $page;
//this will load your master view
$this->load->view("bes/index", $data);
}
}
/* End of file some_controller.php */
/* Location: ./your/controller/path/some_controller.php */
Wish it will help you