template.js

Summary
template.js
bbop.templateBBOP JS template object/enginette.
Functions
template
fillFill the template with the corresponding hash items.
variablesReturn a hash of the variables used in the template.

bbop.template

BBOP JS template object/enginette.

Some (nonsensical) usage is like

var tt = new bbop.template("{{foo}} {{bar}} {{foo}}");
'A B A' == tt.fill({'foo': 'A', 'bar': 'B'});
Summary
Functions
template
fillFill the template with the corresponding hash items.
variablesReturn a hash of the variables used in the template.

Functions

template

bbop.template = function(template_string)

Arguments

template_stringthe string template to use for future fill calls

Returns

self

fill

this.fill = function(fill_hash)

Fill the template with the corresponding hash items.  Undefined variables are replaces with ‘’.

Arguments

fill_hashthe template with the hashed values

Returns

string

variables

this.variables = function()

Return a hash of the variables used in the template.

Arguments

n/a

Returns

a hash like: {‘foo’: true, ‘bar’: true, ...}

bbop.template = function(template_string)
this.fill = function(fill_hash)
Fill the template with the corresponding hash items.
this.variables = function()
Return a hash of the variables used in the template.
Close