summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorxue <>2006-01-16 01:50:52 +0000
committerxue <>2006-01-16 01:50:52 +0000
commit2d6584b56f0c52686f868c4c7dafc44db0f7c5cf (patch)
tree11c638b80b28c0f6c574b443c2ced563bf0ca934 /framework
parenta9d62d90ad6b78618a8491d292d75ceced033f2b (diff)
Fixed an issue with dynamic property tags used with prop:xxx.
Diffstat (limited to 'framework')
-rw-r--r--framework/Web/UI/TTemplateManager.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index d039288e..5d17a6fe 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -608,8 +608,7 @@ class TTemplate extends TComponent implements ITemplate
if($matchStart>$textStart && $container>=0)
{
$value=substr($input,$textStart,$matchStart-$textStart);
- //$tpl[$container][2][$prop]=$this->parseAttribute($value);
- $tpl[$container][2][$prop]=$value;
+ $tpl[$container][2][$prop]=$this->parseAttribute($value);
$textStart=$matchEnd+1;
}
$expectPropEnd=false;
@@ -685,9 +684,11 @@ class TTemplate extends TComponent implements ITemplate
protected function parseAttribute($value)
{
- if(!preg_match('/(<%#.*?%>|<%=.*?%>|<%~.*?%>|<%\\$.*?%>)/msS',$value))
+ $matches=array();
+ if(!preg_match('/^\s*(<%#.*?%>|<%=.*?%>|<%~.*?%>|<%\\$.*?%>)\s*$/msS',$value,$matches))
return $value;
- else if($value[2]==='#') // databind
+ $value=$matches[1];
+ if($value[2]==='#') // databind
return array(self::CONFIG_DATABIND,substr($value,3,strlen($value)-5));
else if($value[2]==='=') // a dynamic initialization
return array(self::CONFIG_EXPRESSION,substr($value,3,strlen($value)-5));