[eluser]JingCleoVil[/eluser]
I am new from CI this is just I wanted to know to have a Master Page so that i will not redundantly make the layout in all pages. Here is my basic code.
index.php - This is my Master Page.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<title>Artisan Websolutions</title>
<link rel="SHORTCUT ICON" href="images/favicon.png" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
</head>
<body>
<div id="global_wrapper">
<div id="wrapper">
<div id="nav_top">
<div class="nav_left"></div>
<div class="nav_mid">
<?php include("includes/nav.php");?>
</div>
<div class="nav_right"></div>
</div>
<div id="cont_wrapper">
<div class="cont_upper"></div>
<div class="cont_mid">
<div id="cont_main">
<?php
$default ='home';
$page = isset($_GET['page']) ? $_GET['page'] : $default;
if (!file_exists('includes/'.$page.'.php')) {
echo 'no such file';
}
include('includes/'.$page.'.php');
?>
</div>
</div>
<div class="cont_lower"></div>
</div>
<div id="footer"><?php include("includes/footer.php")?></div>
</div>
</div>
</body>
</html>
nav.php - my main navigation
Code:
<ul id="navigation">
<li><a href="?page=home"><span><img src="images/home_n.png"></span></a></li>
<li><a href="?page=aboutus"><span><img src="images/aboutus.png"></span</a></li>
</ul>
home.php - my main page
Code:
<div class="main_content">
<h1>My Main Page</h1>
<p>Blah blah blah</p>
</div>
home.php - About US
Code:
<div class="main_content">
<h1>About Us</h1>
<p>Blah blah blah</p>
</div>
Its obviously when you click "about us" link the page will display here
Code:
<div id="cont_main">
?php
$default ='home';
$page = isset($_GET['page']) ? $_GET['page'] : $default;
if (!file_exists('includes/'.$page.'.php')) {
echo 'no such file';
}
include('includes/'.$page.'.php');
</div>
Now I just wanted to do a basic CI code to make this thing happen same process but CI made .Thanks!
PS: SOrry for my English.