Welcome Guest, Not a member yet? Register   Sign In
Best practice for including headers and footers
#1

[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?


Messages In This Thread
Best practice for including headers and footers - by El Forum - 06-22-2008, 05:06 PM
Best practice for including headers and footers - by El Forum - 06-22-2008, 05:15 PM
Best practice for including headers and footers - by El Forum - 06-22-2008, 05:30 PM
Best practice for including headers and footers - by El Forum - 06-22-2008, 05:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB