[eluser]Mr. Pickle[/eluser]
Also I use one view for as a template and then include some sub-view files, so I usualy have the controller send one data array to the skeleton view files. I can maybe do something like this as well
Code:
$data = array(
'header' => array(/* header vars */),
'navigation' => array(/* navigation vars */),
'content' => array(/* content vars */),
'footer' => array(/* footer vars */),
);
$this->load->view('template', $data);
And then have the template
Code:
$this->load->view('header', $header);
$this->load->view('navigation', $navigation);
$this->load->view('content', $content);
$this->load->view('footer', $footer);
Why I use the template view file? -> I don't wan't to load the same view files at every controller function. Is something is added to the template I have to update all my controller functions! Now I only have to update the template view file. Got me thinking though, that if I want to have a section added, I always need to have data passed through the controller so I always have to update the controller, no matter what.
I'm very curious if you would work like this or call
Code:
$this->load->view('header', $header);
$this->load->view('navigation', $navigation);
$this->load->view('content', $content);
$this->load->view('footer', $footer);
at litteraly every controller function?