Template JS Engine: Template engine that takes objects as parameters

Recommend this page to a friend!
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 224 All time: 219 This week: 3Up
Version License JavaScript version Categories
template-js 1.0.2BSD License3.0Templates
Description Author

This object implements a template engine that takes objects as parameters.

It takes a given template string and an array of objects with parameter values that will be used to replace marks in the template string delimited by curly braces { } .

Marks that appear in the template string consecutively indicate that they should be replaced by values of sub-objects of the parameter value objects.

The resulting processed template is inserted in given HTML page elements.

The object may also just return an array of template keys with the respective replacement values.

Innovation Award
JavaScript Programming Innovation award winner
July 2013
Winner


Prize: One downloadable e-book of choice by O'Reilly
Most template engines replace marks with values of variables. Often those values come from variables of objects.

This template engine can simplify the setting of template parameters by allowing to pass whole objects as parameters and have the template engine replace the marks by object variables specified in the template marks.

Manuel Lemos
Picture of Franz Josef Brünner
  Performance   Level  
Name: Franz Josef Brünner <contact>
Classes: 6 packages by
Country: Austria Austria
Age: 37
All time rank: 271 in Austria Austria
Week rank: 6 Up1 in Austria Austria Equal
Innovation award
Innovation award
Nominee: 5x

Winner: 4x

  Files folder image Files  
File Role Description
Plain text file example.html Example Sample output
Plain text file template.js Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:224
This week:0
All time:219
This week:3Up