Why use a templating engine with a framework?

后端 未结 6 1255
迷失自我
迷失自我 2021-02-05 02:56

I recently discovered the PHP framework Kohana (which is awesome) and was reading a thread about using it in conjunction with a templating engine such as Smarty or Twig. My ques

6条回答
  •  一向
    一向 (楼主)
    2021-02-05 03:35

    I have two really good reasons I can think of for doing this...

    1. Creating markup that is repeated throughout the site in a consistent format is easier, plus you can update it later without a lot of grepping.
    2. If this is for a real company, the people determining content aren't likely to be really familiar with HTML, much less PHP. Having a simple template language that keeps styles looking the right way and generates valid markup without much code knowledge is really handy.

提交回复
热议问题