From 370c682479edb2fd3f40ee701f7bb4ef088e8283 Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 7 Apr 2006 03:32:11 +0000 Subject: Breaking change!! Optimized the representation and evaluation of template expression, statements and databind tags. --- .../protected/pages/Configurations/Templates2.page | 30 +++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'demos/quickstart/protected/pages/Configurations') 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

Expression Tags

-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 $this) of the expression is the control owning the template. +

+

+The format of an expression tag is as follows, +

<%= PhpExpression %> -Inernally, an expression tag is represented by a TExpression control. Therefore, in the expression $this refers to the TExpression control. For example, the following expression tag will display the current page title at the place, +

+For example, the following expression tag will display the current page title at the place, +

-<%= $this->Page->Title %> +<%= $this->Title %> -

Statement Tags

-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 echo or print in PHP) are displayed at the place where the statement tag resides in the template. Inernally, a statement tag is represented by a TStatements control. Therefore, in the statements $this refers to the TStatements 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 echo or print in PHP) are displayed at the place where the statement tag resides in the template. The context (namely $this) of the statements is the control owning the template. The format of statement tags is as follows, +

<%% PHP Statements %> -

The following example displays the current time in Dutch at the place, +

<%% setlocale(LC_ALL, 'nl_NL'); echo strftime("%A %e %B %Y",time()); %> -

Databind Tags

-Databind tags are similar to expression tags, except that the expressions are evaluated only when a dataBind() call is invoked on the controls representing the databind tags. Internally, a TLiteral control is used to represent a databind tag and $this 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 dataBind() call is invoked on the controls representing the databind tags. The context (namely $this) of a databind expression is the control owning the template. The format of databind tags is as follows, +

<%# PhpExpression %> -

Parameter Tags

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, +

<%$ ParameterName %> +

Note, application parameters are usually defined in application configurations or page directory configurations. The parameters are evaluated when the template is instantiated.

@@ -66,9 +73,11 @@ Asset tags are used to publish private files and display the corresponding the U

The format of asset tags is as follows, +

<%~ LocalFileName %> +

where LocalFileName 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.

@@ -79,9 +88,12 @@ BE VERY CAUTIOUS when you are using asset tags as it may expose to end-users fil

Localization Tags

Localization tags represent localized texts. They are in the following format, +

<%[string]%> +

where string will be translated to different languages according to the end-user's language preference. +

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