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