MrAnchovy/kohana-themes — Issue #5: Interchangeable PHP/Smarty/Twig/KOstache templates
Author: MrAnchovy
Created: 2011-11-21 23:03:27+00:00
State: open

There are issues with using different template engines interchangeably:

- **performance**: you don't want to be mixing Twig and Smarty templates in the same request. The sensible use is limited to an implementation where you want to do design in Smarty but are reusing pre-existing modules with PHP templates.

- **global template variables**: need to be made global across template engines

- **overloading**: need to prioritise between template engines. File location overhead increases dramatically as template engine support is added so caching becomes vital.

... and each template engine brings issues of its own:
- PHP
- inefficiency of include in tight loops (OK, it's not a big issue because it rarely makes sense to use view files in this way, but I wanted to come up with one!)
- Smarty
- existing Smarty3 module should plug in fairly easily
- Twig
- existing Twig module does not use the concepts of Kohana_View (is there a fork that does?)
- KOstache
- no knowledge