TExpression

TExpression evaluates a PHP expression and displays the evaluation result. To specify the expression to be evaluated, set the Expression property. In a control template, expression tags are often used instead of the complete component tags when the main purpose is to display the evaluation result of some PHP expression. For example, the following two tags are equivalent,

<com:TExpression Expression="date()" /> <%= date() %>

TExpression evaluates the expression during the rendering control lifecycle.

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

<com:TExpression Expression="$this->Page->Title" /> <%= $this->Page->Title %>

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