From 2151151bb43f5c4151d293da8fe4d1806e8842b4 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 9 Aug 2006 12:42:06 +0000 Subject: Added error information when content control doesn't specify a master control. --- framework/Exceptions/messages.txt | 1 + framework/Web/UI/TTemplateControl.php | 2 ++ 2 files changed, 3 insertions(+) (limited to 'framework') diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt index 90872e2f..cbb7cf04 100644 --- a/framework/Exceptions/messages.txt +++ b/framework/Exceptions/messages.txt @@ -164,6 +164,7 @@ control_stylesheet_applied = StyleSheet skin has already been applied to {0}. control_id_nonunique = {0}.ID '{1}' is not unique among all controls under the same naming container. templatecontrol_mastercontrol_invalid = Master control must be of type TTemplateControl or a child class. +templatecontrol_mastercontrol_required = Control '{0}' requires a master control since the control uses TContent. templatecontrol_contentid_duplicated = TContent ID '{0}' is duplicated. templatecontrol_placeholderid_duplicated= TContentPlaceHolder ID '{0}' is duplicated. templatecontrol_directive_invalid = {0}.{1} can only accept a static text string through a template directive. diff --git a/framework/Web/UI/TTemplateControl.php b/framework/Web/UI/TTemplateControl.php index 3bbe52c5..7d1f2d7e 100644 --- a/framework/Web/UI/TTemplateControl.php +++ b/framework/Web/UI/TTemplateControl.php @@ -235,6 +235,8 @@ class TTemplateControl extends TCompositeControl foreach($this->_contents as $id=>$content) $master->injectContent($id,$content); } + else if(!empty($this->_contents)) + throw new TConfigurationException('templatecontrol_mastercontrol_required',get_class($this)); parent::initRecursive($namingContainer); } } -- cgit v1.2.3