new module:ct-element /formatter /Template Formatter()
Formats a value using a template.
- Implements:
Methods
format(vValue, mAttributes) → {String}
Formats a value using a template, using the token {0} to represent the field value.
TemplateFormatter
is typically used in the XML Renderer Framework, but can be invoked programmatically
as in the following example which evaluates to "30 Year":
TemplateFormatter.format(30, {template: "{0} Year")
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
vValue |
Variant | the string. |
||||||
mAttributes |
Map |
the map of attributes. Properties
|
- Implements:
Returns:
the string, formatted using the template.
- Type
- String