From 0574d94e46047b5a669610bc6ebf784be0c7a7bc Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 16 Nov 2005 04:43:07 +0000 Subject: Fixed a bug about storing parsed template. --- framework/Web/UI/TTemplateControl.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'framework/Web/UI') diff --git a/framework/Web/UI/TTemplateControl.php b/framework/Web/UI/TTemplateControl.php index ee205b33..19663002 100644 --- a/framework/Web/UI/TTemplateControl.php +++ b/framework/Web/UI/TTemplateControl.php @@ -41,7 +41,7 @@ class TTemplateControl extends TControl implements INamingContainer /** * @var ITemplate the parsed template structure shared by the same control class */ - protected static $_template=null; + protected static $_template=array(); /** * @var ITemplate the parsed template structure specific for this control instance */ @@ -85,7 +85,8 @@ class TTemplateControl extends TControl implements INamingContainer { if($this->_localTemplate===null) { - eval('$tpl='.get_class($this).'::$_template;'); + $class=get_class($this); + $tpl=isset(self::$_template[$class])?self::$_template[$class]:null; return ($tpl===null && $load)?$this->loadTemplate():$tpl; } else @@ -110,7 +111,7 @@ class TTemplateControl extends TControl implements INamingContainer protected function loadTemplate() { $template=Prado::getApplication()->getService()->getTemplateManager()->getTemplateByClassName(get_class($this)); - eval(get_class($this).'::$_template=$template;'); + self::$_template[get_class($this)]=$template; return $template; } -- cgit v1.2.3