[eluser]mattalexx[/eluser]
In my application's views folder, I created a CakePHP-esque layouts folder. With the layouts folder I put "front", "admin" and "minimal" folders. Within each of these, I put a header.php file and a footer.php file.
Right now, I am putting this code into my controller to include headers and footers:
Code:
class Items extends Controller {
function view($id) {
// Get item
// ...
// Render
$this->load->view("layouts/front/header", array('page_title' => $data['item']['title']));
$this->load->view("items/view", $data);
$this->load->view("layouts/front/footer");
}
}
What I'm asking is, is there a better way to go about applying layouts than this?