摘要
在PHP开发环境中,Smarty模板是一种处于领先地位的主流模板,能高效的实现网站前台和数据库后台之间的交互,将后台数据库中的数据信息呈现在前台网页上。Smarty模板将与数据库的连接等操作封装在类中,在以后的开发中只需要调用即可;利用PHP文件实现对数据库的代码控制,将对数据库的访问结果通过tpl模板文件显示,这种做法使得代码控制和页面美工分离开来,开发过程更加清晰明了。
In PHP development environment, the Smarty template is a mainstream template which can realize the interaction between the front desk and the database. The data information in the background database is presented in the front page. Smarty template encapsulates the operations of connection with database and so on in the class, in the future development only need to call. The PHP file is used to achieve the code control of the database, the database access results are displayed through the TPL template file, this approach separates the code control and the page art, makes the development process more clear.
出处
《计算机时代》
2015年第12期65-66,69,共3页
Computer Era