[eluser]Oscar Dias[/eluser]
If your views inside /include aren't going to change, you can create a library that loads that for you. Something like this:
Code:
class Common {
function show($view, $data = array())
{
// Get current CI Instance
$CI = & get_instance();
// Grabbing all the files associated with the current user
$CI->load->model("membership_model");
$q = $CI->membership_model->user_info();
$data_topMembers['user_info'] = $q;
// Load include views
$CI->load->view('includes/header');
$CI->load->view('includes/topMembers', $data_topMembers);
$CI->load->view('includes/news');
$CI->load->view($view, $data);
$CI->load->view('includes/footer');
}
}
Depending on your needs this might be a good solution. You can pass additional parameters, for example SEO information for your header view... Then in your controller you do:
Code:
$this->load->library('common');
$this->common->show($main_content);