<?phpclass template{private $file = NULL; // -- Load Fileprivate $content = NULL; // -- File Loadedprivate $tags = array(); // -- Tags Addedprivate $count = 0; // -- Loop of Tagspublic function fread($archive){$this->file = @fopen($archive, "r");$this->content = @fread($this->file, filesize($archive));if(!$this->file) exit("Error open: {$archive}");if(!$this->content) exit("Error read: {$archive}");}public function set($name, $value){$this->tags[$this->count++] = array("name" => $name, "value" => $value);}public function show(){foreach($this->tags as $tags)$this->content = str_replace("{".$tags['name']."}", $tags['value'], $this->content);eval("?>".$this->content."<?");}}define("TITLE", "Ben Sayfa Başlığıyım"); // -- Page Title$veri="ben bir sayfa içeriğiyim";$template = new template(); // -- Load Class$template->set("TITLE", TITLE); // -- Add the tag {TITLE}$template->set("ICERIK", $veri); // -- Add the tag {ICERIK}switch($_GET["page"]){case "home" :$template->fread("template/index.tpl.php"); // -- Load the index.tpl.phpbreak;default :$template->fread("template/index.tpl.php"); // -- Load the index.tpl.phpbreak;}$template->show(); // -- Show template//alttaki html kodlarını template/index.tpl.php dosyası oluşturarak içine yazınız/*<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>{TITLE}</title></head><body>{CONTENT}</body></html>*/// çalıştırmak için localhost/index.php?page=home tarzı case e göre?>