mirror of
https://github.com/thinkjs/thinkjs.git
synced 2026-01-25 14:42:47 +00:00
16 lines
417 B
JavaScript
16 lines
417 B
JavaScript
/**
|
|
* ejs
|
|
* https://github.com/visionmedia/ejs
|
|
* @type {[type]}
|
|
*/
|
|
var ejs = require("ejs");
|
|
module.exports = {
|
|
fetch: function(templateFile, tVar){
|
|
var content = getFileContent(templateFile);
|
|
var conf = C('tpl_engine_config');
|
|
conf.filename = templateFile; //enable include
|
|
var fn = ejs.compile(content, conf);
|
|
var html = fn(tVar);
|
|
return html;
|
|
}
|
|
} |