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 (5 years ago) RSS 2.0 feedNot enough user ratingsTotal: 221 All time: 217 This week: 6Up
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
  Performance   Level  
Name: Franz Josef Brünner <contact>
Classes: 6 packages by
Country: Austria Austria
Age: 34
All time rank: 281 in Austria Austria
Week rank: 59 Down1 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:221
This week:0
All time:217
This week:6Up