diff options
-rw-r--r-- | demos/quickstart/protected/pages/Configurations/Templates1.page | 2 | ||||
-rw-r--r-- | demos/quickstart/protected/pages/Configurations/Templates3.page | 2 | ||||
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 9 |
3 files changed, 7 insertions, 6 deletions
diff --git a/demos/quickstart/protected/pages/Configurations/Templates1.page b/demos/quickstart/protected/pages/Configurations/Templates1.page index f6b7dd16..ce539281 100644 --- a/demos/quickstart/protected/pages/Configurations/Templates1.page +++ b/demos/quickstart/protected/pages/Configurations/Templates1.page @@ -33,7 +33,7 @@ To deal conveniently with properties taking take big trunk of initial data, the PropertyValue
</prop:PropertyName>
</com:TTextHighlighter>
-It is equivalent to <tt>...PropertyName="PropertyValue"...</tt> in a component tag except that the latter may accept <a href="?page=Configurations.Templates3">dynamic property tags</a>. Property initialization tags must be directly enclosed between the corresponding opening and closing component tag.
+It is equivalent to <tt>...PropertyName="PropertyValue"...</tt> in every aspect. Property initialization tags must be directly enclosed between the corresponding opening and closing component tag.
</p>
<a name="tct" />
diff --git a/demos/quickstart/protected/pages/Configurations/Templates3.page b/demos/quickstart/protected/pages/Configurations/Templates3.page index ae496553..e5abc347 100644 --- a/demos/quickstart/protected/pages/Configurations/Templates3.page +++ b/demos/quickstart/protected/pages/Configurations/Templates3.page @@ -35,7 +35,7 @@ Note, unlike dynamic content tags, the expressions tags for component properties <a name="dt" />
<h3>Databind Tags</h3>
<p>
-Databind tags are similar to expression tags, except that the expressions are evaluated only when a <tt>dataBind()</tt> call is invoked on the controls represented by the component tags. In the expression, <tt>$this</tt> refers to the control itself. Databind tags do not apply to all components. They can only be used for controls.
+Databind tags are similar to expression tags, except that they can only be used with control properties and the expressions are evaluated only when a <tt>dataBind()</tt> call is invoked on the controls represented by the component tags. In the expression, <tt>$this</tt> refers to the control itself. Databind tags do not apply to all components. They can only be used for controls.
</p>
<p>
The format of databind tags is as follows,
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));
|