Forumlar / Cotonti / Development / Twig: modern template language

Trustmaster
#26046 2010-09-11 04:27
Well, you don't have to rebuild anything and it acts pretty same way as before except for a few things:
  1. You can put logical IF/ELSE/ENDIF blocks inside of other logical blocks. And normal BEGIN/END blocks inside of logical blocks. And combine them how you want.
  2. You can pass template variables through PHP functions using callbacks a.k.a. extensions or pipes. Just like this: {FORUMS_TOPIC_TITLE|str_replace('Twig', 'FooBar', $this)|stripslashes}.

Other details are more technical, like a better template compiler which eliminates any parsing at render-time. I think nobody here truly realizes what he'd need nested logical/begin-end blocks for. I just made a different architecture which makes it possible.
May the Source be with you!