12345678910111213141516171819202122 |
- var View = function(src,params){
- if(!src) return null;
- this.html = '';
- this.parse
- this.params = params?params:{};
- if(!src.match(VIEWSPATH)){
- src = VIEWSPATH+src;
- }
- if(FILE.existsSync(src)){
- var data = FILE.readFileSync(src,'UTF-8');
- this.html = EJS.render(data,this.params);
- }else{
- return null;
- }
-
- return this;
- }
- module.exports = View;
|