Пример #1
0
 view:function(cfg){
   if(cfg.tpl){
     view.init(cfg.tpl);
   }
   if(cfg.debug){
     view.debug(cfg.debug);
   }
   if(cfg.constant){
     view.constant(cfg.constant);
   }
   return this;
 },
Пример #2
0
/**
  cfg = {
    listen:80 , [needed]
  }
  **/
function Server(cfg){
  this.cfg = this.prepareCfg(cfg);
  this.root = cfg.root;
  this.routermap = {};
  this.filtermap = function(){};
  this.serv = null;
  if(cfg.tpl){
    view.init(cfg.tpl);
  }else{
    view.render = function(){return 'view is not inited ! please re-config the server .';};
  }
}