diff options
author | xue <> | 2005-11-14 20:16:22 +0000 |
---|---|---|
committer | xue <> | 2005-11-14 20:16:22 +0000 |
commit | e9ee04d2f156c3ffbb50b3def689d716d1943243 (patch) | |
tree | 2b2d2c0778e91feeff1ee346a8f45047a2cfc855 /framework/Web/UI/TTemplate.php | |
parent | e3c51f08c1cffbbc4aa1a42d9893866fbd648f9b (diff) |
Modified the way to create a new component so that a better error message can be displayed.
Diffstat (limited to 'framework/Web/UI/TTemplate.php')
-rw-r--r-- | framework/Web/UI/TTemplate.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/framework/Web/UI/TTemplate.php b/framework/Web/UI/TTemplate.php index c441d7c1..0e36f2f4 100644 --- a/framework/Web/UI/TTemplate.php +++ b/framework/Web/UI/TTemplate.php @@ -93,7 +93,18 @@ class TTemplate extends TComponent implements ITemplate if(isset($object[2])) // component
{
if(strpos($object[1],'.')===false)
- $component=new $object[1];
+ {
+ if(class_exists($object[1],false))
+ $component=new $object[1];
+ else
+ {
+ include_once($object[1].Prado::CLASS_FILE_EXT);
+ if(class_exists($object[1],false))
+ $component=new $object[1];
+ else
+ throw new TTemplateRuntimeException('template_component_unknown',$object[1]);
+ }
+ }
else
$component=Prado::createComponent($object[1]);
if($component instanceof TControl)
|