summaryrefslogtreecommitdiff
path: root/framework/Web/UI
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI')
-rw-r--r--framework/Web/UI/WebControls/TRepeater.php26
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;
}
/**