[eluser]gtech[/eluser]
you could create a library, create function in a library that takes in a view name and data aray as parameters. you the get the CI instance ($CI =& get_instance()
and then load the views...
eg:
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Template {
function dotemplate($template, $data)
{
$CI =& get_instance();
$CI->load->view('header');
$CI->load->view($template, $data);
$CI->load->view('footer');
}
}
?>
in the controller you load the library (or autoload it) and the instead of loading the view you call the dotemplate function. If you don't like that approach, then search on the forums as this is a common topic.
good luck!
I suppose you could also create a base controller that has a method which loads the header content and footer. when you create a new controller you extend from the base controller and then the template method will be available. I have not tried this approach but it should work.