. Tpl and. php

Source: Internet
Author: User
. Tpl and. php are learning the smarty framework recently.
Some. tpl files contain html and php code.
What is the difference between. tpl and. php?
(My idea: use. tpl for mixed code such as. php and html for pure php code)


Reply to discussion (solution)

Tpl is the abbreviation of template.

Smarty is a template engine that uses a custom template language to separate the display logic from the business logic (corresponding to the mvc v and M)
The advantage of using the template engine is that when designing the business logic code, you do not need to consider how to display the running results in the future. This makes it possible for the program to keep improving.
When creating a user interface, you don't need to know how the data comes from. you just need to display the data as needed on the interface.

Whether or not the template engine is used, php + html mixed encoding is used.

. Tpl is just a template. no matter what the file ends with, the final running file is. php.
The smarty template engine does this separation. Of course there are other functions.

Wow, the upstairs profile picture is fascinating.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.