[eluser]Unknown[/eluser]
So I've been tinkering with CI, and I'm pretty sure I want to use it for my next project, but I've been putting together a demo site, and I'm a bit uncomfortable with how I find myself repeating my view code in my controllers.
I've created a few views out of some content that I intend to repeat a bit: 'header', 'nav', 'footer', the content was mainly broken up for organizational purposes.
I then surround the view that I'm working on in my controller, like so:
Code:
$this->load->view('header');
$this->load->view('nav');
$this->load->view('register', $data);
$this->load->view('footer');
So, I guess this is a two part question:
1) I'm typing this stuff in *every* controller I make, and it just feels like there might be a better solution for this rather than copy and pasting the general views on every controller that I make.
2) With regards to these repetitive pages, if I need to run general queries or assignments to pass in generic data to the view, that will *also* be copied into every view. (example: passing in some session data into the nav view)
I read the wiki about using multiple views on the same page, and while it told you *how*, it didn't really jump at talking about if there was a better perceived way about handling this kind of stuff.
Any advice/comments is appreciated.