index.js
function View(tplPath, tplFile, data){
	this.data = data||{};
	this.defines = {};
	this.enabled = true;
	// Default settings
	this.settings = doT.templateSettings;
	this.settings.varname = 'it,helpers'; // Add the helpers as a second data param for the parser
	this.settings.cache = true; // Use memory cache for compiled template functions
	this.settings.layout = /\{\{##\s*(?:def\.)?_layout\s*(?:\:|=)\s*([\s\S]+?)\s*#\}\}/; // Layout regex
	if(tplPath){ this.path = tplPath; }
	if(tplFile){
		this.file = tplFile;
		this.layout();
	}
}
function View(tplPath, tplFile, data){
	this.data = data||{};
	this.defines = {};
	this.enabled = true;
	// Default settings
	this.settings = doT.templateSettings;
	this.settings.varname = 'it,helpers'; // Add the helpers as a second data param for the parser
	this.settings.cache = true; // Use memory cache for compiled template functions
	this.settings.layout = /\{\{##\s*(?:def\.)?_layout\s*(?:\:|=)\s*([\s\S]+?)\s*#\}\}/; // Layout regex
	if(tplPath){ this.path = tplPath; }
	if(tplFile){
		this.file = tplFile;
		this.layout();
	}
}
function View ( tplPath , tplFile , data ) { this . data = data || { } ; this . defines = { } ; this . enabled = true ; // Default settings this . settings = doT . templateSettings ; this . settings . varname = 'it,helpers' ; // Add the helpers as a second data param for the parser this . settings . cache = true ; // Use memory cache for compiled template functions this . settings . layout = / \{\{##\s*(?:def\.)?_layout\s*(?:\:|=)\s*([\s\S]+?)\s*#\}\} / ; // Layout regex if ( tplPath ) { this . path = tplPath ; } if ( tplFile ) { this . file = tplFile ; this . layout ( ) ; } }
Object constructor. For quick use, the most important properties can be set in the constructor.
@constructor
@param {string} [tplPath] - The path of the template file
@param {string} [tplFile] - The filename of the template file
@param {object} [data={}] - The template data
@return {View}
Object constructor . For quick use the most important properties can be set in the constructor .