Here is a simple library that takes advantages of layouts in code igniter. You can call it in your controller like:
$this->layout->view('dashboard');
You can pass data to it just like load->view:
$data = array('foo'=>'bar'); $this->layout->view('dashboard',$data);
Either configure your autoloader to load the layout or load the library in your controller:
$this->load->library('layout');
If you wish to change the layout from default you do so in your controller:
$this->layout->setLayout('secondary');