vkTemplate is a very small, simple and powerful template solution for web applications.
Pull request Compare This branch is 5 commits behind vkiryukhin:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
html
php
tmpl
README
index.html
jquery.1.5.0.js
main.css
main.js
smartupdater.js
vktemplate.js

README

/**
* vkTemplate - jQuery Plugin
*  
* Version - 0.93.00.beta ( ECMAScript-5 strict mode compatible)
* Copyright (c) 2010 - 2011 Vadim Kiryukhin
* vkiryukhin @ gmail.com
* http://www.eslinstructor.net/vktemplate/
* 
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*
* _tmpl function is "Micro-Templating" engine, 
* originally written by John Resig ( http://ejohn.org/ - MIT Licensed )
* and modified by Vadim Kiryukhin. Issue with single quotes is fixed based on Neil's comment at 
* http://www.west-wind.com/weblog/posts/2008/Oct/13/Client-Templating-with-jQuery
*
*	.vkTemplate(urlTemplate, jsonData [,params] [,callback(elm, data, context)] [,context]) 
*
* PARAMETERS:
*
*	@urlTemplate  	- template URL;
* 	@jsonData		- can be either json object or json string or URL 
*	
*	@params			- jQuery Ajax "data" parameter that is sent to the 
*                     server with jsonData URL if needed (optional)
* 	@function		- callback function (optional)
*	@context		- object to pass as a context (optional)
*
* USAGE:
*	
*	$('#container').vkTemplate('myTemplate.tmpl','myData.php'); 
*	$('#container').vkTemplate('myTemplate.tmpl','{"foo":"bar"}');
*	$('#container').vkTemplate('myTemplate.tmpl',{foo:"bar"});
*	$('#container').vkTemplate('myTemplate.tmpl','myData.php', function(elm, jsonObj){...});
*   $('#container').vkTemplate('myTemplate.tmpl','myData.php', {id:123});
*	$('#container').vkTemplate('myTemplate.tmpl','myData.php', {id:123}, function(elm, jsonObj){...});
*
*	When @context is provided, all optional parameters must be provided as well. 
*   If they are not used, set them to null.
*
*   $('#container').vkTemplate('myTemplate.tmpl','myData.php',null,null,contextObj); 
*
*	Use "o." prefix with this version of Strict Mode Compatible Micro-Templating engine:
* 	object:    {first_name:"John",last_name:"Smith"} 
* 	template:  <%= o.first_name %>  <% if(o.first_name == ... ) {} %> 
*		
*/