[eluser]razerone[/eluser]
[quote author="PravinS" date="1382704728"]you can also try like this
$data['footer'] = 'common/footer';
$data['header'] = 'common/header';
$this->load->view('template',$data);
and include this views in view as
include($header);
include($footer);
[/quote]
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends CI_Controller {
public function index() {
$this->load->helper('array');
$this->load->helper('path');
if (file_exists('views/theme' . 'default/template/common/home.tpl')) {
$this->load->view('theme'. 'default/template/common/home.tpl');
}
else {
$this->load->view('theme/default/template/common/home.tpl');
}
$this->children = array(
'common/footer',
'common/header'
);
}
}
This is way I have done but need to use array or some thing suitable