A template system in PHP is a single class or a set of classes included into the code. Typically it is a part of an application framework, but may be used also for a few single pages.
Currently, template-engines are most frequently used in the context of development for the web.
A template will be useful in mass-producion of web documents. It will help you to not repeat the same task over and over again and enhancing teamwork by allowing separation of work.
The smallest implementation of a template class would be to just look into a file (the template) and replace some keywords This can happen in different ways – str_replace, regular expressions or compiling,
Other solutions extend this idea to have sections / blocks to handle sub-templates in a single file.
An often criticized solution is to implement a template-language on top of PHP to perform loops and so on. Since this can be done in PHP anyway, and just would produce overhead with no real benefit.
Other point out PHP itself is a template-engine and therefore you don’t need a template-system at all.
What in fact was true when PHP was created by Rasmus Lerdorf in 1995. Nowadays PHP has gone far beyond this…
There are huge sites on the internet completely written in PHP and it would be unwise not to use templates.
Others again say to not use templates but use MVC – Patterns (Model–View–Controller).
But this is not an XOR (Exclusive-or) in fact you can use both or even use templates in your MVC to layout the view e.g.
Visit my Template Project at SKOR PHP-Template