cotopboy
9/2/2013 - 12:28 PM

Code Igniter Load a generic page template

Code Igniter Load a generic page template

<html>
<body>
  <div id = "header">
      <?php $this->load->view('header');?>
      <?php $this->load->veiw('navigation');?>
  </div>
  <div id = "sidenav">
     <?php $this->load->view('sidenav');?>
  </div>
  <div id = "content">
     <?php echo $content;?>
   </div>

  <div id = "footer">
      <?php $this->load->view('footer');?>
 </body>
 </html>

Load your more dynamic areas by making use of codeigniter's abiltiy to return a view as a variable in your controller:



$template['content'] = $this->load->view('content',$data,TRUE);
$this->load->view('page_template',$template);