Dynamic content tags are introduced as shortcuts to some commonly used component tags. These tags are mainly used to render contents resulted from evaluating some PHP expressions or statements. They include expression tags, statement tags, databind tags, parameter tags and asset 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,
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,
The following example displays the current time in Dutch at the place,
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,
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,
Asset tags are used to publish private files and display the corresponding the URLs. For example, if you have an image file that is not Web-accessible and you want to make it visible to end-users, you can use asset tags to publish this file and show the URL to end-users so that they can fetch the published image.
The format of asset tags is as follows,
BE VERY CAUTIOUS when you are using asset tags as it may expose to end-users files that you probably do not want them to see.