summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TTemplate.php
diff options
context:
space:
mode:
authorxue <>2005-11-14 15:51:35 +0000
committerxue <>2005-11-14 15:51:35 +0000
commite3c51f08c1cffbbc4aa1a42d9893866fbd648f9b (patch)
treed429ab554ef267a2eb737a16727c83427f3e4414 /framework/Web/UI/TTemplate.php
parent2b13059f007b3fc583d7509e101f56e98640c1cb (diff)
Added support to dynamic expression for control attributes.
Diffstat (limited to 'framework/Web/UI/TTemplate.php')
-rw-r--r--framework/Web/UI/TTemplate.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/framework/Web/UI/TTemplate.php b/framework/Web/UI/TTemplate.php
index 160a00f0..c441d7c1 100644
--- a/framework/Web/UI/TTemplate.php
+++ b/framework/Web/UI/TTemplate.php
@@ -141,7 +141,13 @@ class TTemplate extends TComponent implements ITemplate
throw new TTemplateRuntimeException('property_read_only',get_class($component).'.'.$name);
}
else if($component->getAllowCustomAttributes())
+ {
+ if(is_array($value) && $value[0]===1)
+ $value=$component->evaluateExpression($value[1]);
+ else
+ throw new TTemplateRuntimeException('template_attribute_unbindable',$name);
$component->getAttributes()->add($name,$value);
+ }
else
throw new TTemplateRuntimeException('property_not_defined',get_class($component).'.'.$name);
}