Programmer-why is the template engine used in the PHP framework? What are the consequences if you don't need it?

Source: Internet
Author: User
Why is the template engine used in the PHP framework? What are the consequences if you don't need it? Why is the template engine used in the PHP framework? What are the consequences if you don't need it?

Reply content:

Why is the template engine used in the PHP framework? What are the consequences if you don't need it?

PHP is a language that can be mixed with HTML code. It is okay to write a small project in this way, but as the amount of Code increases, opening a large piece of code is full of labels,
At the same time, such writing will make code reuse very troublesome.

The template engine separates php code from html code to make the code structure clearer.
In addition, the template engine makes code reuse concise and easy.

In short, the emergence of the template engine only makes code work easier and more convenient.

The template engine is used to make it easier for PHP users to write webpages. I think the biggest advantage of using the template engine is that you may run this template in PHP, and suddenly you want to run it in Python, maybe you just need to find a corresponding parsing library, instead of modifying the template code. Of course, PHP itself can become a template language, so I don't think there are any serious consequences.

I am a front-end and have a department principle. I don't participate in any or logic, and I don't 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.