[eluser]Unknown[/eluser]
How do I load common page elements with minimal code?
Currently, to keep my content views clean I only put the contents of my page in views, then have a single head and foot.
This is what my controller would call to pull up the add profile page:
Code:
$this->load->view('head', $data);
$this->load->view('volunteers/add_profile.php');
$this->load->view('foot');
I'm just curious if there is a shortcut anywhere for this, or a better way of doing this.
What I don't want is to make views that actually have page layout information in them other than what is directly required for that particular view.
(meaning I don't want header information in the actual add_profile view, because I might want to use that view somewhere else, or I might want to change the header on all of my pages)
I've thought of doing something like this:
Code:
$data['page']='volunteers/add_profile.php';
$this->load->view('template', $data);
Then have the content portion pull in the $page.
Thoughts?