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

前端 未结 10 1647
青春惊慌失措
青春惊慌失措 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条回答
  •  -上瘾入骨i
    2021-02-05 03:16

    Separation of concerns.

    This sort of things comes as standard when using a MVC/MTV approach - where the presentation of data is necessarily separated from the display of data, but not if you're using plain ol' PHP.

    Using a template engine makes it easy to separate out what's being displayed from how it's being displayed.

    I suppose you could argue that this falls under "babysitting bad developers", since a good developer ought to do this anyway, but in my view, a template engine makes it easier for good developers too.

提交回复
热议问题