Edit this topic


: shell

: tokens

: tokens

: /modules/core/tokens/services/token.js

: https://github.com/DecentCMS/DecentCMS/blob/master/modules/core/tokens/services/token.js

class: Token

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).

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

describe: The name of the scope event triggered when a token service calls for pipe extensions to register themselves.