Plik po sparsowaniu z rozszerzeniem PHP
<!DOCTYPE html> <head> <title>Tytuł</title> </head> <body> </body> </html>
Teraz mam pytanie czemu to nie działa, tzn. nic oprócz Tytułu w tagu <title></title> się nie wyświetla ?
Kod Parsera
<?php class Template { var $TemplateDir = "themes/default"; var $CacheDir = "cache"; ( "#\[b\](.*?)\[/b\]#" => "<strong>\\1</strong>", "#\[if (.*?)\](.*?)\[/if\]#" => "<?php if (\\1) { echo \"\\2\"; } ?>" ); function Template($filename) { $this->baseDir = $this->TemplateDir; $this->cacheDir = $this->CacheDir; $this->fileTemplateExt = $filename.".tpl"; $this->fileCacheExt = $filename.".php"; $this->fileTemplate = $this->baseDir."/".$this->fileTemplateExt; $this->fileCache = $this->cacheDir."/".$this->fileCacheExt; } function LoadTemplate() { { } foreach($this->code as $source => $destination) { } } function Replacer($name, $value) { } function Show() { if(!$this->Exists()) { $this->Save($this->template); return $this->Load(); } else { return $this->Load(); } } function Exists() { } function Save($data) { } function Load() { } } ?>