uchome的模板处理主要调用/source目录下的function_template.php文件中的parse_template函数实现(比起smarty可真是超轻量级了).
解析过程并不复杂,主要是读取模板文件(.htm),用规则表达式替换标记为PHP标准语法,最终生成一个标准的PHP文件,保存到缓存目录


1:读入模板文件,模板文件一般在template/default下面
);   
    }  
2:对模板标记解析
变量:
);  
逻辑解析:
);  
循环和常量
//循环
);  

3:最后写入到/data/tpl_cache/目录下

//write   
    if(!swritefile($objfile, $template)) {   
        
exit("File: $objfile can not be write!");   
    }  

相关文章:

  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2021-09-26
  • 2021-09-13
  • 2021-12-07
  • 2022-02-25
猜你喜欢
  • 2021-12-12
  • 2021-06-11
  • 2022-12-23
  • 2021-06-07
  • 2022-01-22
  • 2021-06-01
  • 2021-11-17
相关资源
相似解决方案