You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
444 B

  1. /**
  2. * 渲染模板(根据模板名)
  3. * @name template.render
  4. * @param {String} 模板名
  5. * @param {Object} 数据
  6. * @return {String} 渲染好的字符串
  7. */
  8. var renderFile = template.renderFile = function (filename, data) {
  9. var fn = template.get(filename) || showDebugInfo({
  10. filename: filename,
  11. name: 'Render Error',
  12. message: 'Template not found'
  13. });
  14. return data ? fn(data) : fn;
  15. };