Programmer-Why do I use a template engine inside the PHP framework? What if there's no consequence?

Source: Internet
Author: User
Why use a template engine inside the PHP framework? What if there's no consequence?

Reply content:

Why use a template engine inside the PHP framework? What if there's no consequence?

PHP is a language that can be mixed with HTML code, which is fine to write small items, but as the amount of code grows, the code opens a large chunk of tags,
At the same time, this kind of writing can make the code reuse cumbersome.

The template engine appears to implement the separation of PHP code and HTML code, which makes the code structure look clearer.
In addition, the template engine makes the reuse of code simple and easy.

In short, the advent of the template engine just wants the code to work easier and easier, and you don't have to have any consequences.

The template engine is designed to make it easier for people who don't understand PHP to write Web pages. With the template engine I think the biggest advantage is that you can run the template in PHP, suddenly you want to put in Python run, you may just find a corresponding parsing library, rather than to change the template code. Of course, PHP itself can become a set of template language, so no template engine I think there is no serious consequences.

I am a front-end, department has a principle, do not participate in any and no logic, do not modify any PHP

  • 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.