Forum Moderators: coopster
I believe jatar posted something like this which got me going.
// includes/template.php
<?php
include 'includes/header.php';
include 'includes/content.php';
include 'includes/footer.php';
?>// includes/content.php
<div id="content"><!-- main content goes in here -->
<?php include $content;?>
</div><!-- end content -->// index.php
<?php
$content = "includes/content/main.php";
include "includes/template.php";
?>// includes/header.php
<html>
<head>
<title></title>
</head>
<body>// includes/content/main.php
<p>put content here</p>// footer.php
</body>
</html>
I personally, ehhhh! could be controversial on this, don't like template based system. I think it makes easy things look more difficult. I rely on PHP system that I have made during my programming years. It is based on OOP.
To make it easier to read php move as much of your php into an included file. So I have an included file that has a function to print the nav bar, then you just call it as echo nav(); at the bottom of the html.
<rant>
Cool...
like xhtml is...yet how many people are serving xhtml as application/xhtml+xml, its all text/html.
Ajax was cool, everyone used it...for loading images that were not needed and other stupid stuff just to show how great a web developer they were.
Templates are cool, if you dont use them then you are so 2000...
All of these things have there place, but you need to decide if your use is because this is the best thing for you...or just cos its cool.
</rant>
Im going to sit outside and look at the moon to calm down ;)