. TPL vs. php
Recently learning the Smarty framework
See some. tpl files that are written in HTML and PHP code
What is the difference between a. TPL and. php
(Personal idea: pure PHP code is used in.. TPL for mixed code such as PHP php+html)
------to solve the idea----------------------
TPL is the abbreviation for template (Chinese interpretation: Templates)
Smarty is a template engine that uses a custom template language to achieve separation of display logic and business logic (respectively, V and M for MVC)
The advantage of using a template engine is that when you design your business logic code, you don't have to think about how the results of the run will be presented in the future. It's possible that the program will keep improving.
And in the user interface, do not need to know how to get the data, just need to display the data as the interface needs to be able to
Regardless of whether the template engine is used, the final execution is php+html hybrid encoding
------to solve the idea----------------------
The. TPL is just a template, no matter what the end of the file is, the final running file is. php
Smarty Template engine is doing this kind of separation work, of course, there are other functions
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.