diff options
author | xue <> | 2006-04-18 02:32:07 +0000 |
---|---|---|
committer | xue <> | 2006-04-18 02:32:07 +0000 |
commit | 0b6ffbe14058e7453ae9861d2e4a1633b0a2f534 (patch) | |
tree | 2fda9324c8077ad2b84ba9ac518ae119c6b86e03 /framework/Web/UI/TTemplateManager.php | |
parent | 2c3a19d691be5e8d1e0a5e7839fc9ced549b04ee (diff) |
Merge from 3.0 branch till 934.
Diffstat (limited to 'framework/Web/UI/TTemplateManager.php')
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 13a5cd28..90070a5a 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -202,6 +202,7 @@ class TTemplate extends TApplicationComponent implements ITemplate * @var string hash code of the template
*/
private $_hashCode='';
+ private $_tplControl=null;
/**
@@ -275,6 +276,7 @@ class TTemplate extends TApplicationComponent implements ITemplate */
public function instantiateIn($tplControl)
{
+ $this->_tplControl=$tplControl;
if(($page=$tplControl->getPage())===null)
$page=$this->getService()->getRequestedPage();
$controls=array();
@@ -405,7 +407,13 @@ class TTemplate extends TApplicationComponent implements ITemplate $component->bindProperty($name,$value[1]);
break;
case self::CONFIG_EXPRESSION:
- $component->autoBindProperty($name,$value[1]);
+ if($component instanceof TControl)
+ $component->autoBindProperty($name,$value[1]);
+ else
+ {
+ $setter='set'.$name;
+ $component->$setter($this->_tplControl->evaluateExpression($value[1]));
+ }
break;
case self::CONFIG_TEMPLATE:
$setter='set'.$name;
@@ -451,7 +459,10 @@ class TTemplate extends TApplicationComponent implements ITemplate $component->bindProperty($name,$value[1]);
break;
case self::CONFIG_EXPRESSION: // expression
- $component->autoBindProperty($name,$value[1]);
+ if($component instanceof TControl)
+ $component->autoBindProperty($name,$value[1]);
+ else
+ $component->setSubProperty($name,$this->_tplControl->evaluateExpression($value[1]));
break;
case self::CONFIG_TEMPLATE:
$component->setSubProperty($name,$value[1]);
@@ -823,7 +834,7 @@ class TTemplate extends TApplicationComponent implements ITemplate {
foreach($attributes as $name=>$att)
{
- if(is_array($att) && ($att[0]===self::CONFIG_DATABIND || $att[0]===self::CONFIG_EXPRESSION))
+ if(is_array($att) && ($att[0]===self::CONFIG_DATABIND))
throw new TConfigurationException('template_databind_forbidden',$type,$name);
if(($pos=strpos($name,'.'))!==false)
{
|