diff options
author | xue <> | 2005-11-14 15:51:35 +0000 |
---|---|---|
committer | xue <> | 2005-11-14 15:51:35 +0000 |
commit | e3c51f08c1cffbbc4aa1a42d9893866fbd648f9b (patch) | |
tree | d429ab554ef267a2eb737a16727c83427f3e4414 /framework/Web | |
parent | 2b13059f007b3fc583d7509e101f56e98640c1cb (diff) |
Added support to dynamic expression for control attributes.
Diffstat (limited to 'framework/Web')
-rw-r--r-- | framework/Web/UI/TTemplate.php | 6 | ||||
-rw-r--r-- | framework/Web/UI/TThemeManager.php | 2 |
2 files changed, 7 insertions, 1 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);
}
diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php index 8edae2e1..019ccc85 100644 --- a/framework/Web/UI/TThemeManager.php +++ b/framework/Web/UI/TThemeManager.php @@ -150,7 +150,7 @@ class TTheme extends TTemplate foreach($this->_skins[$type][$id] as $name=>$value)
{
if(is_array($value))
- $value=$this->evaluateExpression($value);
+ $value=$this->evaluateExpression($value[1]);
if(strpos($name,'.')===false) // is simple property or custom attribute
{
if($control->hasProperty($name))
|