[eluser]xwero[/eluser]
There are libraries you can check out that provide a clean way but i don't think it can be simpler than the solution i proposed as it uses the already existing functionality of the framework.
Code:
// template.php
function get_template() // basic function
{
$CI =& get_instance();
$CI->load->view('layout');
}
// config/hooks.php
$hook['post_controller'] = array(
'class' => '',
'function' => 'get_template',
'filename' => 'template.php',
'filepath' => 'hooks',
);
// views/layout.php
<html>
<head>
<title></title>
<head>
<body>
<?php echo $content ?>
</body>
</html>
// some_controller.php
function some_function()
{
$array = array('some_view_var'=>'value',
'content'=>$this->load->view('some_view','',TRUE));
$this->load->vars($array);
}
The some_view_var value is magically attached to the var in some_view and the some_view is added to the layout. I think it's a very flexible way of using a base template layout.