ludo.tpl.Parser


new ludo.tpl.Parser()

JSON Content compiler. This parser works with a template string, like: "

{lastname}, {firstname}

" and a JSON
array, like: [{"firstname":"John", "lastname": "Anderson"},{"firstname":"Anna", "lastname": "Anderson"}] and returns

{Anderson}, {John}

{Anderson}, {Anna}

.

It walks through all the objects in the JSON array and uses the template string on each one of them.

Source:

Extends

  • Core

Methods


getCompiled(records, tpl) → {Array}

Get compiled string

Parameters:
Name Type Description
records Array
tpl String
Source:
Returns:

string items

Type
Array