What are the real advantages of templating engines over just using PHP?

前端 未结 10 1639
青春惊慌失措
青春惊慌失措 2021-02-05 02:33

I develop my web applications using only PHP for the view files and I don\'t feel limited in any way, but I hear there\'s a consistent number of developers advocating \"external

10条回答
  •  后悔当初
    2021-02-05 03:13

    Easy switching between views

    With the current state of the web, I need to provide my information in different formats:

    • A static html page
    • A dynamically loaded view on another HTML page
    • A JSON object of the data
    • An XML feed of the data, used in my flash part

    The information for these formats can be equal, only the view differs. Using some sort of template engine, I can quickly switch between these views.

提交回复
热议问题