From 965aa3d9475a86642d33ace50d52c77987a125ea Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 26 Mar 2006 18:23:31 +0000 Subject: Added tutorial page for TExpression and TStatements. --- .../protected/pages/Controls/Statements.page | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'demos/quickstart/protected/pages/Controls/Statements.page') 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 @@

TStatements

+

+TStatements evaluates a sequence of PHP statements and displays the content rendered by the statements. To specify the PHP statements to be evaluated, set the Statements property. In a control template, statement tags are often used instead of the complete component tags when the main purpose is to display the result rendered by some PHP statements. For example, the following two tags are equivalent, +

+ +<com:TStatements> + <prop:Expression> + setlocale(LC_ALL, 'nl_NL'); + echo strftime("%A %e %B %Y",time()); + </prop:Expression> +</com:TStatements> + +<%% + setlocale(LC_ALL, 'nl_NL'); + echo strftime("%A %e %B %Y",time()); +%> + + +

+TStatements evaluates the PHP statements during the rendering control lifecycle. Unlike TExpression, TStatements only displays the content 'echoed' within the statements. +

+ +

+The context of the statements in a TStatements control is the control itself. That is, $this 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 TStatements control. +

+ +<%% + $page=$this->Page; + echo $page->Title; +%> + + +

+Be aware, since TStatements allows execution of arbitrary PHP code, in general you should not use it to evaluate PHP code submitted by your application users. +

+ \ No newline at end of file -- cgit v1.2.3