fluid.stringTemplate(template, values)

Simple string template system. Takes a template string containing tokens in the form of "%value". Returns a new string with the tokens replaced by the specified values. Keys and values can be of any data type that can be coerced into a string. Arrays will work here as well.

fluid.stringTemplate(template, values)

File name:Fluid.js

Parameters

template

(String) a string (can be HTML) that contains tokens embedded into it

values

(Object) a collection of token keys and values

Return Value

The string with the values inserted.

See Also

Examples

In the following example, a data object of key/value pairs is used to produce the string "Paused at: 12 of 14 files (100 Kb of 12000Gb)"