Well for this work i have some best method which call layouts
Number 1 :
go to your views folder and create a new folder see the bellow image

Number 2 : add new php file name it layout.php and add this code in the layout.php file
<?php
$this->load->view('common/header');
$this->load->view($view_page);
$this->load->view('common/footer');
Note : the common is my folder name which is located in views folder
Number 3 : Now add the custom controller file inside core folder see in the image

And add the following code in this file
<?php
class MY_Controller extends CI_Controller
{
protected $data;
function __construct() {
parent::__construct();
}
/* Load the front end layout and set the ouput */
public function render($layout)
{
$this->load->view('layouts/'.$layout, $this->data);
}
}
Number 4 : Go to your controller file and extends your controller with this file see in the image

Now you able to load your views and pass data to views by the following code
public function index(){
$this->data['view_page'] = 'index';
$this->render('layout');
}
You can send data with method see the following function.
public function index(){
$this->data['pass_your_data_var_here'] = $data;
$this->data['view_page'] = 'index';
$this->render('layout');
}