Browse Source

Update mysql funcs

HonorLee 7 years ago
parent
commit
8849644f16
1 changed files with 4 additions and 3 deletions
  1. 4 3
      system/lib/core/view.js

+ 4 - 3
system/lib/core/view.js

@@ -5,13 +5,14 @@ var View = function(src,params){
     this.params = params?params:{};
 
     if(!src.match(Core.Path.View)){
-        src = Core.Path.View + src;
+        src = Core.Path.View + src + '.html';
     }
 
-    if(FILE.existsSync(src)){
+    try{
+        FILE.statSync(src);
         var data = FILE.readFileSync(src,'UTF-8');
         this.html = EJS.render(data,this.params);
-    }else{
+    }catch(e){
         return null;
     }