I made a blog post about how I was unhappy with CI’s view handling for multiple views. I was looking for layouts that loaded views, so i turned to the “view object” from the wiki
one of my readers pointed out that I could do this instead:
//instead of displaying the view to screen, you get it’s content in $content
$alldata['title'] = “Some page variable”;
//you should have a <?=content_holder?> in your layout
$alldata['content_holder'] = $this->load->view(’content’, $content_data, true);
$this->load->view(’layout’, $alldata);
The third argument of load->view() is not documented in the user guide. Maybe I missed it, but I couldn’t find it. I think it should be included, it makes things so much easier.
You can read the blog post and comments here.
http://joshhighland.com/blog/2008/04/29/improving-codeigniters-view-handling
