Форумы / Cotonti / Development / Twig: modern template language

Trustmaster
#25924 04.09.2010 04:20
I can name a few reasons why we should not move to Twig:
  1. Twig is view-driven. XTemplate is controller-driven. Twig blocks are absolutely different things rather than XTemplate blocks. Twig blocks are hierarchic structure elements. XTemplate blocks are parsing logic elements as well, still driven by controller - which is pretty unique to XTemplate, despite the fact that it is still push-based like most MVC template engines. This means that you cannot replace XTemplate with Twig without rewriting the controller logic completely.
  2. XTemplate2 was built in KISS spirit, just less than 500 lines of code which do the job. But a hundred classes in 250kB of code means no simplicity of this kind.
  3. Do we really need that complexity in TPL files?

For me point 1 is the showstopper, the rest 2 are more or less acceptable in some circumstances. In addition, compiled templates don't always mean speed, in case speed claims make you choose Twig.
May the Source be with you!