[eluser]selftaught[/eluser]
I am looking for advice to add a navigation menu in my header view so it is rendered on each page request. Sorry for the newby question.
site.php (controller)
<?php
class Site extends CI_Controller {
function contact_us()
{
$data['main_content'] = 'contact_us';
$this->load->view('template',$data);
}
function about_us()
{
$data['main_content'] = 'about_us';
$this->load->view('template',$data);
}
}
template.php (template)
<?php
$this->load->view('includes/header');
$this->load->view($main_content);
$this->load->view('includes/footer');
?>
header.php (included/header view)
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" contnent="text/html; charset=utf-8">
<title>untitled</title>
</head>
<body>
<p>This comes from the header view</p>
footer.php (included/footer view)
<p>This is the footer</p>
</body>
</html>
about_us.php (about_us view)
This is the about us page.about
Any help is greatly appreciated.
-Chris