summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Configurations/Templates2.page
diff options
context:
space:
mode:
authorxue <>2006-04-07 03:46:10 +0000
committerxue <>2006-04-07 03:46:10 +0000
commit4226093cc034dfbd25a5b9e9aee2778e795ee42a (patch)
treefadba0312deb52211b71360977cdad992c07abc3 /demos/quickstart/protected/pages/Configurations/Templates2.page
parent123e74a758d84429f1a24e047f3b61e8ca0f6979 (diff)
Merge from 3.0 till 868.
Diffstat (limited to 'demos/quickstart/protected/pages/Configurations/Templates2.page')
-rw-r--r--demos/quickstart/protected/pages/Configurations/Templates2.page30
1 files changed, 21 insertions, 9 deletions
diff --git a/demos/quickstart/protected/pages/Configurations/Templates2.page b/demos/quickstart/protected/pages/Configurations/Templates2.page
index f4f68b69..0971c828 100644
--- a/demos/quickstart/protected/pages/Configurations/Templates2.page
+++ b/demos/quickstart/protected/pages/Configurations/Templates2.page
@@ -10,52 +10,59 @@ Dynamic content tags are introduced as shortcuts to some commonly used <a href="
<a name="et"></a>
<h3>Expression Tags</h3>
<p>
-An expression tag represents a PHP expression that is evaluated when the template control is being rendered. The expression evaluation result is inserted at the place where the tag resides in the template. Its format is as follows,
+An expression tag represents a PHP expression that is evaluated when the template control is being rendered. The expression evaluation result is inserted at the place where the tag resides in the template. The context (namely <tt>$this</tt>) of the expression is the control owning the template.
+</p>
+<p>
+The format of an expression tag is as follows,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
&lt;%= PhpExpression %&gt;
</com:TTextHighlighter>
-Inernally, an expression tag is represented by a <tt>TExpression</tt> control. Therefore, in the expression <tt>$this</tt> refers to the <tt>TExpression</tt> control. For example, the following expression tag will display the current page title at the place,
+<p>
+For example, the following expression tag will display the current page title at the place,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
-&lt;%= $this-&gt;Page-&gt;Title %&gt;
+&lt;%= $this-&gt;Title %&gt;
</com:TTextHighlighter>
-</p>
<a name="st"></a>
<h3>Statement Tags</h3>
<p>
-Statement tags are similar to expression tags, except that statement tags contain PHP statements rather than expressions. The output of the PHP statements (using for example <tt>echo</tt> or <tt>print</tt> in PHP) are displayed at the place where the statement tag resides in the template. Inernally, a statement tag is represented by a <tt>TStatements</tt> control. Therefore, in the statements <tt>$this</tt> refers to the <tt>TStatements</tt> control. The format of statement tags is as follows,
+Statement tags are similar to expression tags, except that statement tags contain PHP statements rather than expressions. The output of the PHP statements (using for example <tt>echo</tt> or <tt>print</tt> in PHP) are displayed at the place where the statement tag resides in the template. The context (namely <tt>$this</tt>) of the statements is the control owning the template. The format of statement tags is as follows,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
&lt;%%
PHP Statements
%&gt;
</com:TTextHighlighter>
-</p>
<p>
The following example displays the current time in Dutch at the place,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
&lt;%%
setlocale(LC_ALL, 'nl_NL');
echo strftime("%A %e %B %Y",time());
%&gt;
</com:TTextHighlighter>
-</p>
<a name="dt"></a>
<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 representing the databind tags. Internally, a <tt>TLiteral</tt> control is used to represent a databind tag and <tt>$this</tt> in the expression would refer to the control. The format of databind tags is as follows,
+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 representing the databind tags. The context (namely <tt>$this</tt>) of a databind expression is the control owning the template. The format of databind tags is as follows,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
&lt;%# PhpExpression %&gt;
</com:TTextHighlighter>
-</p>
<a name="pt"></a>
<h3>Parameter Tags</h3>
<p>
Parameter tags are used to insert application parameters at the place where they appear in the template. The format of parameter tags is as follows,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
&lt;%$ ParameterName %&gt;
</com:TTextHighlighter>
+<p>
Note, application parameters are usually defined in application configurations or page directory configurations. The parameters are evaluated when the template is instantiated.
</p>
@@ -66,9 +73,11 @@ Asset tags are used to publish private files and display the corresponding the U
</p>
<p>
The format of asset tags is as follows,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
&lt;%~ LocalFileName %&gt;
</com:TTextHighlighter>
+<p>
where <tt>LocalFileName</tt> refers to a file path that is relative to the directory containing the current template file. The file path can be a single file or a directory. If the latter, the content in the whole directory will be made accessible by end-users.
</p>
<p>
@@ -79,9 +88,12 @@ BE VERY CAUTIOUS when you are using asset tags as it may expose to end-users fil
<h3>Localization Tags</h3>
<p>
Localization tags represent localized texts. They are in the following format,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
&lt;%[string]%&gt;
</com:TTextHighlighter>
+<p>
where <tt>string</tt> will be translated to different languages according to the end-user's language preference.
+</p>
</com:TContent> \ No newline at end of file