From 4226093cc034dfbd25a5b9e9aee2778e795ee42a Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 7 Apr 2006 03:46:10 +0000 Subject: Merge from 3.0 till 868. --- framework/Web/UI/TControl.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'framework/Web/UI/TControl.php') diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index 52ec9bb1..15965a74 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -68,7 +68,7 @@ Prado::using('System.Web.UI.TControlAdapter'); * @package System.Web.UI * @since 3.0 */ -class TControl extends TApplicationComponent +class TControl extends TApplicationComponent implements IRenderable, IBindable { /** * format of control ID @@ -772,7 +772,7 @@ class TControl extends TApplicationComponent if(isset($this->_rf[self::RF_CONTROLS])) { foreach($this->_rf[self::RF_CONTROLS] as $control) - if($control instanceof TControl) + if($control instanceof IBindable) $control->dataBind(); } } @@ -1416,10 +1416,12 @@ class TControl extends TApplicationComponent { foreach($this->_rf[self::RF_CONTROLS] as $control) { - if($control instanceof TControl) - $control->renderControl($writer); - else if(is_string($control)) + if(is_string($control)) $writer->write($control); + else if($control instanceof TControl) + $control->renderControl($writer); + else if($control instanceof IRenderable) + $control->render($writer); } } } @@ -1660,13 +1662,13 @@ class TControlCollection extends TList */ public function insertAt($index,$item) { - if(is_string($item)) - parent::insertAt($index,$item); - else if($item instanceof TControl) + if($item instanceof TControl) { parent::insertAt($index,$item); $this->_o->addedControl($item); } + else if(is_string($item) || ($item instanceof IRenderable)) + parent::insertAt($index,$item); else throw new TInvalidDataTypeException('controlcollection_control_required'); } -- cgit v1.2.3