A PHP templates (Theme) engine allows developers and designers to work on the same areas, but without disturbing each other. A data fetched and proceeded by backend will be delivered to a template where they can be modifieded and displayed as final output.

    Separation

  • When an app code grows and begins to be unreadable, developers think about the project files structure. Separation between Model, View, and Controller is required by the design pattern, however developers and designer still need to work on their common code. And the template file is the best place for such collaboration.

    Readability

  • Logic and presentation mixed together in project files were not clear enough. Just check any template used by WordPress if you do not believe me. It looks terrible and it’s very hard to understand for the designer.

    Caching

  • Good template engines offer caching for static files. Special syntax brings many features, but it needs to be parsed and compiled with source language. Template engines, like Smarty and Twig, have better performance with compiled files, which is another caching layer for web application.