当前位置:首页>开发>正文

php的smarty框架的原理是什么 php中怎么使用smarty

2024-01-10 18:32:28 互联网 未知 开发

 php的smarty框架的原理是什么 php中怎么使用smarty

php的smarty框架的原理是什么

php的smarty是一个php开发的模版系统,根本目的是为了实现页面和逻辑的分离,同时可以辅助我们进行php系统的快速开发,其中集成插件技术,缓存系统等技术,对前端页面优化和速度优化有很大的帮助作用,其中的编译型系统可以做到只需编译一次模版就可以长久使用。
实现原理:
1.php端逻辑实现文件(php文件)
2.模版文件(html文件)
3.编译系统把php逻辑实现文件和模版文件结合编译成静态html文件,即生成缓存文件
4.显示

php中怎么使用smarty?

简单应用
include smarty.php
smart = new smarty

smarty->assign(const, $const)
smarty->display(tem.htm)

最新文章