diff options
author | xue <> | 2006-01-15 01:15:21 +0000 |
---|---|---|
committer | xue <> | 2006-01-15 01:15:21 +0000 |
commit | 2d64368647a8aa1afff52eaea20b1416e51f9e85 (patch) | |
tree | 8e15f33dd0b36496164aef0553caebd0ff47ddab /framework/Web/UI/WebControls | |
parent | 0a40bca6deb8ee25fe9380c071d49b8234da76f2 (diff) |
Modified the way of creating templates.
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r-- | framework/Web/UI/WebControls/TRepeater.php | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/framework/Web/UI/WebControls/TRepeater.php b/framework/Web/UI/WebControls/TRepeater.php index c71f6590..a75fd63e 100644 --- a/framework/Web/UI/WebControls/TRepeater.php +++ b/framework/Web/UI/WebControls/TRepeater.php @@ -293,26 +293,24 @@ class TRepeater extends TDataBoundControl implements INamingContainer protected function createTemplate($str)
{
$key=md5($str);
- $contextPath=$this->getTemplateControl()->getTemplate()->getContextPath();
- if(($cache=$this->getApplication()->getCache())!==null)
+ if(isset(self::$_templates[$key]))
+ return self::$_templates[$key];
+ else
{
- if(($template=$cache->get($key))===null)
+ $contextPath=$this->getTemplateControl()->getTemplate()->getContextPath();
+ if(($cache=$this->getApplication()->getCache())!==null)
{
- $template=new TTemplate($str,$contextPath);
- $cache->set($key,$template,self::CACHE_EXPIRY);
+ if(($template=$cache->get($key))===null)
+ {
+ $template=new TTemplate($str,$contextPath);
+ $cache->set($key,$template,self::CACHE_EXPIRY);
+ }
}
- }
- else
- {
- if(isset(self::$_templates[$key]))
- $template=self::$_templates[$key];
else
- {
$template=new TTemplate($str,$contextPath);
- self::$_templates[$key]=$template;
- }
+ self::$_templates[$key]=$template;
+ return $template;
}
- return $template;
}
/**
|