[eluser]markanderson993[/eluser]
I agree with Crackz0r that a templating system would be a great way to solve your problem. To implement it however, I was able to create a library named template.php, which I added to my autoload config. My class looked something like this..
*edit - sorry for the lack of formatting. I just slapped some code out there and couldn't find a convenient way to format it
Code:
<?php
class Template {
function load($view = '', $vars = array(), $return = false) {
$this->CI =& get_instance();
if(!isset($vars['head_title'])) $vars['head_title'] = $this->CI->config->item('website_name');
$vars['template_contents'] = APPPATH . 'views/'.$view;
return $this->CI->load->view('template/container', $vars, $return)
}
}
The beauty in a class like this is that whenever you're ready to load a view via a controller.. you can do something like this
Code:
class Home extends CI_Controller {
function index() {
$data = array(); // super awesome
$this->template->load('home/index',$data);
}
}
Hope this helps you out!