<? class page { var $content; var $title; var $footer; function init() { head(); body(); foot(); } function head() { echo "<html>\n<head>\n<title>".$this->title."</title>\n"; css(); echo "\n</head>"; } function css() { echo "<style type=\"text/css\">\n"; echo "Put styles here!"; echo "\n</style>"; } function body() { echo $this->content; } function foot() { echo "\n".$this->footer; } } ?>
index.php:
<? include("page.php"); $page = new page(); $page->title = "KSKS"; $page->content = "asdsada"; $page->footer = ":D"; $page->init(); ?>
and thats a basic template class.
I did this in a hurry because I have to go to class