Welcome Guest, Not a member yet? Register   Sign In
Suggestion on how to do a site like codeigniter.com
#2

[eluser]jblack199[/eluser]
You can do it how I did it, in my view I created an includes folder which has a header.php, footer.php and a template.php

my template.php:
Code:
<?php $this->load->view('adm/includes/header'); ?>

<?php $this->load->view($main_content); ?>

<?php $this->load->view('adm/includes/footer'); ?>

note: my paths have the adm for this, specifically because this is for the administration panel for my site.

my header.php is just that, all the html and php to create the header and everything else... footer.php again all the html and php needed to create my footer..

then in my controller i do:

Code:
$data['main_content'] = 'view_name';
$this->load->view('includes/template', $data);

and it'll work for you... not too tricky to get it to work.


Messages In This Thread
Suggestion on how to do a site like codeigniter.com - by El Forum - 08-11-2011, 09:35 PM
Suggestion on how to do a site like codeigniter.com - by El Forum - 08-11-2011, 11:39 PM
Suggestion on how to do a site like codeigniter.com - by El Forum - 08-12-2011, 12:03 AM
Suggestion on how to do a site like codeigniter.com - by El Forum - 08-12-2011, 12:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB