I\'m looking for advice on the best practice for separating site content up into logical blocks. I want a header and footer that are constant throughout the site, so that if
In building off of Your Common Sense's answer, there's not a good reason to have 2 files for every page. You can easily combine your template (YCS called this .tpl.php) and your actual page into one file.
First, start off with a class that you can expand as your template needs expand:
Then, make your layout:
PageTitle)) { echo $TPL->PageTitle; } ?>
ContentHead)) { include $TPL->ContentHead; } ?>
ContentBody)) { include $TPL->ContentBody; } ?>
And finally, add your page with the body content:
PageTitle = "My Title";
$TPL->ContentBody = __FILE__;
include "layout.php";
exit;
}
?>