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