diff options
author | xue <> | 2005-11-15 15:34:38 +0000 |
---|---|---|
committer | xue <> | 2005-11-15 15:34:38 +0000 |
commit | 4c9067bf7ae89b446bb0e236ab20c5b4fa3ee3e3 (patch) | |
tree | be5b2366fdedd2d2789955deb18ef7e072ca4e6e /framework/Web/UI/TTemplateManager.php | |
parent | fdce469afc80e6cf922c07500f9b7bfd5b302c35 (diff) |
Added a new template/theme syntax for URL support.
Diffstat (limited to 'framework/Web/UI/TTemplateManager.php')
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 6 |
1 files changed, 3 insertions, 3 deletions
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;
}
|