Token
: shell
: tokens
: tokens
: /modules/core/tokens/services/token.js
: https://github.com/DecentCMS/DecentCMS/blob/master/modules/core/tokens/services/token.js
Token
Kind: global class
- Token
- new Token(scope)
- instance
- .interpolate(str, context) ⇒
String
- .interpolate(str, context) ⇒
- static
- .registerPipesEvent :
String
- .registerPipesEvent :
new Token(scope)
String token interpolation service for DecentCMS.
| Param | Type |
|---|---|
| scope | object |
token.interpolate(str, context) ⇒ String
Injects token values using the provided context. The method uses Markup.js as the templating engine (see https://github.com/adammark/Markup.js).
Kind: instance method of Token
Returns: String - The interpolated string where tokens have been replaced with their values
| Param | Type | Description |
|---|---|---|
| str | String |
The string in which tokens must be evaluated |
| context | Object |
The context object against which tokens are evaluated |
Token.registerPipesEvent : String
Kind: static property of Token
Describe: The name of the scope event triggered when a token service
calls for pipe extensions to register themselves.