From 46dd185faab6a0387face5700c4b69c69f9f933c Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 9 Apr 2006 17:12:45 +0000 Subject: Cache key for TOutputCache now also uses PagePath. --- framework/Web/UI/TTemplateManager.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'framework/Web/UI/TTemplateManager.php') diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 07d65fd0..7961a121 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -289,11 +289,11 @@ class TTemplate extends TApplicationComponent implements ITemplate if(isset($object[2])) // component { $component=Prado::createComponent($object[1]); - if($component instanceof TOutputCache) - $component->setCacheKeyPrefix($this->_hashCode.$key); $properties=&$object[2]; if($component instanceof TControl) { + if($component instanceof TOutputCache) + $component->setCacheKeyPrefix($this->_hashCode.$key); $component->setTemplateControl($tplControl); if(isset($properties['id'])) { @@ -332,17 +332,16 @@ class TTemplate extends TApplicationComponent implements ITemplate $parent->addParsedObject($component); } } - else // string + else if(is_string($object[1])) + $parent->addParsedObject($object[1]); + else if($object[1] instanceof TCompositeLiteral) { - if($object[1] instanceof TCompositeLiteral) - { - $o=clone $object[1]; - $o->setContainer($tplControl); - $parent->addParsedObject($o); - } - else - $parent->addParsedObject($object[1]); + $o=clone $object[1]; + $o->setContainer($tplControl); + $parent->addParsedObject($o); } + else + throw new TConfigurationException('template_content_unexpected',(string)$object[1]); } } -- cgit v1.2.3