From 4c9067bf7ae89b446bb0e236ab20c5b4fa3ee3e3 Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 15 Nov 2005 15:34:38 +0000 Subject: Added a new template/theme syntax for URL support. --- framework/Web/UI/TTemplateManager.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'framework/Web/UI/TTemplateManager.php') diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 843d2460..2703500a 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -40,10 +40,10 @@ class TTemplateManager extends TComponent implements IModule public function getTemplateByFileName($fileName) { - if(is_file($fileName)) + if(($fileName=realpath($fileName))!==false && is_file($fileName)) { if(($cache=$this->_application->getCache())===null) - return new TTemplate(file_get_contents($fileName)); + return new TTemplate(file_get_contents($fileName),dirname($fileName)); else { $array=$cache->get(self::TEMPLATE_CACHE_PREFIX.$fileName); @@ -53,7 +53,7 @@ class TTemplateManager extends TComponent implements IModule if(filemtime($fileName)<$timestamp) return $template; } - $template=new TTemplate(file_get_contents($fileName)); + $template=new TTemplate(file_get_contents($fileName),dirname($fileName)); $cache->set(self::TEMPLATE_CACHE_PREFIX.$fileName,array($template,time())); return $template; } -- cgit v1.2.3