Exemple #1
0
 function display($tpl = 0)
 {
     $module = empty(APP::$__module) ? "" : APP::$__module . '/';
     $tpl = $tpl ? $tpl : APP::$__controller . '_' . APP::$__action;
     $tplfile = APP_FILE . APP::$config['app']['view_file'] . $module . $tpl . '.html';
     if (!file_exists($tplfile)) {
         APP::error('can not load template file : ' . $tplfile);
     }
     $compliefile = APP_FILE . APP::$config['app']['runtime_file'] . $module . md5($tpl) . '.php';
     //缓存文件
     if (!file_exists($compliefile) || filemtime($tplfile) > filemtime($compliefile)) {
         $_v = new View();
         $_v->parse($tplfile, $module);
     }
     include_once $compliefile;
 }