${...}: Universal interpolation

Synopsis

${expression}

Where:

Description

The universal interpolation is used to output the string value of an expression. The string value of an expression is defined as follows:

  1. if the expression evaluates to a TemplateNumberModel, then it is output in the format specified with the number_format setting (but note that a more fine-grained formatting control can be achieved using the string built-in). So this usually (by default) prints for human audience, as opposed to computer audience; see the c built-in for more information.

  2. if the expression evaluates to a TemplateDateModel, then it is output in the format specified with the time_format, date_format, or datetime_format setting, depending on whether the date information is time-only, date-only, or a datetime. Read about ?string for dates for more information.

  3. if the expression evaluates to a TemplateScalarModel, then its string value is output as is.

  4. if the engine is not in classic compatibility mode, and neither of the above holds, the evaluation ends with an error. Otherwise:

  5. if the expression evaluates to a TemplateBooleanModel, true values are output as the literal "true", false values are output as empty string. To output boolean values outside the classic compatibility mode, apply the ?string built-in explicitly on a boolean expression.

  6. if the expression is undefined it is output as empty string.

  7. in all other cases, the evaluation ends with an error.


Page generated: 2006-03-15 13:49:01 GMT FreeMarker Manual -- For FreeMarker 2.3.6