|
|
|
|
|
by Mahn
4087 days ago
|
|
> When you use a templating engine, you can change the backend entirely without messing with the template. You can also compile/optimize the display of data in the template more easily. To be fair, all that you can do with a templating engine you can do "natively" as well. You can for example have code-less templates in PHP if you are disciplined enough to keep it that way. The only thing template engines do is enforce not being able to shoot yourself in the feet, but it's not an absolute must if you know what you are doing. |
|
Also, sometimes when you use PHP, you have to sacrifice correctness or speed for readability. You don't have that problem when you're running templates that were compiled to PHP, rather than hand-written PHP.
Finally, template inheritance is absolutely amazing. Can't live without it now.