Class TemplateToken
- Version
- 0.1
- Defined in
- Template.js
Token objects used by Template to apply and display data granularly.
Constructor Attributes | Constructor Name and Description |
---|---|
TemplateToken(opts)
Individual token objects used by Template objects to render their appropriate
content.
|
Method Attributes | Method Name and Description |
---|---|
getValue()
Gets the value of the token, taking into account any default values that have been defined.
|
|
hasValue()
Returns a boolean
true|false representing whether or not there is a returnable value. |
|
replaceIn(txt)
Replaces the current value for any occurrences of the raw token string in the provided
txt |
|
setValue(val)
Sets the value of this token to the provided
val , taking into account any
modifiers in its calculation. |
Class Detail
TemplateToken(opts)
Individual token objects used by Template objects to render their appropriate
content. TemplateToken syntax is expected as:
Author: Garth Henson (Guahan Web).
${{<title>|<mod_name>="<mod_value>"}}
where:
title: | The title of the current token (used to assign values) |
mod_name: | Name of the modifier(s). Valid modifiers are covered in TemplateToken#parseToken. |
mod_value: | Value of the current modifier (ie, type="text" ) |
Author: Garth Henson (Guahan Web).
- Parameters:
- {Object} opts
- Options used to configure the template
Method Detail
{varied}
getValue()
Gets the value of the token, taking into account any default values that have been defined.
- Returns:
- {varied} The current value
{boolean}
hasValue()
Returns a boolean
true|false
representing whether or not there is a returnable value.
- Returns:
- {boolean} Whether or not there is a value assigned