Icontem

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    
Last Updated Ratings Unique User Downloads Download Rankings
2014-05-03 (2 years ago) RSS 2.0 feedNot enough user ratingsTotal: 212 All time: 213 This week: 46Up
Version License JavaScript version Categories
template-js 1.0.1BSD 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
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:212
This week:0
All time:213
This week:46Up