summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TTemplateManager.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/TTemplateManager.php')
-rw-r--r--framework/Web/UI/TTemplateManager.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index 45884f02..abeb7466 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -252,6 +252,9 @@ class TTemplate extends TComponent implements ITemplate
$controls=array();
foreach($this->_tpl as $key=>$object)
{
+ $parent=isset($controls[$object[0]])?$controls[$object[0]]:$tplControl;
+ if(!$parent->getAllowChildControls())
+ continue;
if(isset($object[2])) // component
{
$component=Prado::createComponent($object[1]);
@@ -270,7 +273,6 @@ class TTemplate extends TComponent implements ITemplate
// apply attributes
foreach($object[2] as $name=>$value)
$this->configureControl($component,$name,$value);
- $parent=isset($controls[$object[0]])?$controls[$object[0]]:$tplControl;
$component->createdOnTemplate($parent);
}
else if($component instanceof TComponent)
@@ -283,17 +285,11 @@ class TTemplate extends TComponent implements ITemplate
}
foreach($object[2] as $name=>$value)
$this->configureComponent($component,$name,$value);
- $parent=isset($controls[$object[0]])?$controls[$object[0]]:$tplControl;
$parent->addParsedObject($component);
}
}
else // string
- {
- if(isset($controls[$object[0]]))
- $controls[$object[0]]->addParsedObject($object[1]);
- else
- $tplControl->addParsedObject($object[1]);
- }
+ $parent->addParsedObject($object[1]);
}
}