summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages
diff options
context:
space:
mode:
authorxue <>2006-03-26 18:23:31 +0000
committerxue <>2006-03-26 18:23:31 +0000
commit965aa3d9475a86642d33ace50d52c77987a125ea (patch)
tree07dc84b404c97b06d3c7b63b8649f58cbe29b50a /demos/quickstart/protected/pages
parentdbf96121469b00c070b95095dcae2b1c408581dc (diff)
Added tutorial page for TExpression and TStatements.
Diffstat (limited to 'demos/quickstart/protected/pages')
-rw-r--r--demos/quickstart/protected/pages/Controls/Expression.page22
-rw-r--r--demos/quickstart/protected/pages/Controls/Standard.page6
-rw-r--r--demos/quickstart/protected/pages/Controls/Statements.page35
3 files changed, 59 insertions, 4 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Expression.page b/demos/quickstart/protected/pages/Controls/Expression.page
index 767f292f..efa1ab7a 100644
--- a/demos/quickstart/protected/pages/Controls/Expression.page
+++ b/demos/quickstart/protected/pages/Controls/Expression.page
@@ -4,7 +4,27 @@
<com:DocLink ClassPath="System.Web.UI.WebControls.TExpression" />
<p>
-TBD
+<tt>TExpression</tt> evaluates a PHP expression and displays the evaluation result. To specify the expression to be evaluated, set the <tt>Expression</tt> property. In a control template, <a href="?page=Configurations.Templates2#et">expression tags</a> are often used instead of the complete <a href="?page=Configurations.Templates1#ct">component tags</a> when the main purpose is to display the evaluation result of some PHP expression. For example, the following two tags are equivalent,
+</p>
+<com:TTextHighlighter Language="prado" CssClass="source">
+&lt;com:TExpression Expression="date()" /&gt;
+&lt;%= date() %&gt;
+</com:TTextHighlighter>
+
+<p>
+<tt>TExpression</tt> evaluates the expression during the rendering control lifecycle.
+</p>
+
+<p>
+The context of the expression in a <tt>TExpression</tt> control is the control itself. That is, <tt>$this</tt> represents the control object if it is present in the expression. For example, both of the following template tags will display the title of the page containing the <tt>TExpression</tt> control.
+</p>
+<com:TTextHighlighter Language="prado" CssClass="source">
+&lt;com:TExpression Expression="$this->Page->Title" /&gt;
+&lt;%= $this->Page->Title %&gt;
+</com:TTextHighlighter>
+
+<p>
+Be aware, since <tt>TExpression</tt> allows execution of arbitrary PHP code, in general you should not use it to evaluate expressions submitted by your application users.
</p>
</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Standard.page b/demos/quickstart/protected/pages/Controls/Standard.page
index ab485233..11c8eaec 100644
--- a/demos/quickstart/protected/pages/Controls/Standard.page
+++ b/demos/quickstart/protected/pages/Controls/Standard.page
@@ -19,7 +19,7 @@
<a href="?page=Controls.DatePicker">TDatePicker</a> represents an input field taking date values via a calendar dialog.
</li>
- <li>*
+ <li>
<a href="?page=Controls.Expression">TExpression</a> accepts a PHP expression and displays the evaluation result on a Web page.
</li>
@@ -95,7 +95,7 @@
<a href="?page=Controls.SafeHtml">TSafeHtml</a> displays its body content with assurance that the content contain no harmful code (such as <a href="?page=Security.XSS">XSS</a>).
</li>
- <li>*
+ <li>
<a href="?page=Controls.Statements">TStatements</a> accepts a few PHP statements and displays their standard output on the Web page.
</li>
@@ -107,7 +107,7 @@
<a href="?page=Controls.TextBox">TTextBox</a> represents a text input field on a Web page. It can collect single-line, multi-line or password text input from users.
</li>
- <li>*
+ <li>
<a href="?page=Controls.TextHighlighter">TTextHighlighter</a> highlights its body content according to the specified syntax highlighter, such as PHP, XML, PRADO, etc.
</li>
diff --git a/demos/quickstart/protected/pages/Controls/Statements.page b/demos/quickstart/protected/pages/Controls/Statements.page
index 28f25791..f37f1dc4 100644
--- a/demos/quickstart/protected/pages/Controls/Statements.page
+++ b/demos/quickstart/protected/pages/Controls/Statements.page
@@ -3,4 +3,39 @@
<h1>TStatements</h1>
<com:DocLink ClassPath="System.Web.UI.WebControls.TStatements" />
+<p>
+<tt>TStatements</tt> evaluates a sequence of PHP statements and displays the content rendered by the statements. To specify the PHP statements to be evaluated, set the <tt>Statements</tt> property. In a control template, <a href="?page=Configurations.Templates2#st">statement tags</a> are often used instead of the complete <a href="?page=Configurations.Templates1#ct">component tags</a> when the main purpose is to display the result rendered by some PHP statements. For example, the following two tags are equivalent,
+</p>
+<com:TTextHighlighter Language="prado" CssClass="source">
+&lt;com:TStatements&gt;
+ &lt;prop:Expression&gt;
+ setlocale(LC_ALL, 'nl_NL');
+ echo strftime("%A %e %B %Y",time());
+ &lt;/prop:Expression&gt;
+&lt;/com:TStatements&gt;
+
+&lt;%%
+ setlocale(LC_ALL, 'nl_NL');
+ echo strftime("%A %e %B %Y",time());
+%&gt;
+</com:TTextHighlighter>
+
+<p>
+<tt>TStatements</tt> evaluates the PHP statements during the rendering control lifecycle. Unlike <tt>TExpression</tt>, <tt>TStatements</tt> only displays the content 'echoed' within the statements.
+</p>
+
+<p>
+The context of the statements in a <tt>TStatements</tt> control is the control itself. That is, <tt>$this</tt> represents the control object if it is present in the statements. For example, the following statement tag will display the title of the page containing the <tt>TStatements</tt> control.
+</p>
+<com:TTextHighlighter Language="prado" CssClass="source">
+&lt;%%
+ $page=$this->Page;
+ echo $page->Title;
+%&gt;
+</com:TTextHighlighter>
+
+<p>
+Be aware, since <tt>TStatements</tt> allows execution of arbitrary PHP code, in general you should not use it to evaluate PHP code submitted by your application users.
+</p>
+
</com:TContent> \ No newline at end of file