During the transition days, we have spent some time on discussing a new template engine for FLOW3 and TYPO3 v4.
I felt really motivated after this week, that's why I started out to implement the concept we discussed there, mainly to gain some experience.
We've been looking at many templating engines, including PHPTal and Smarty, but for each of them, there were some things that did not really suit our needs (We've written down some facts about that in the FAQ on forge).
As the templating engine will be an integral part of FLOW3, and one part the developer deals a lot with, we sat down to think about how templating should really be.
It should be simple and powerful. Not limiting your possibilities, but enforcing clean templates. Use convention over configuration. Provide guides and help whereever possible. Be intuitive and easy to learn.
Already da Vinci said "Simplicity is the ultimate sophistication" - so our template language is very slim, but also very flexible.
Don't be scared, that's just the working name of the templating engine (short for Best Engineered templateEngine Replacement) - any ideas concerning the name are welcome!
View Helpers are just methods which you can use in your view, and they can perform various things. BEER3 ships with some standard view helpers (conditions, loops, link helpers, ...) but you can easily write your own.
Every view helper resides in a certain package.
Let's take an easy example: Imagine you want to output a list of all blog postings in a template. The follwing snippet will do that:
<f3:loop each="{posts}" as="post">
{post.title}
</f3:loop>
View helpers are very easily written. For an example, check our work-in-progress documentation in the wiki.
Quite soon after we started playing around with the template engine, I spent some time investigating autocompletion of the view helper tags.
And as an image is worth a thousand words, and a video is worth a thousand pictures, I have created a small mockup where I show how autocompletion can work in eclipse. Watch it here, as it is really cool!
As far as I know it, there is no other templating engine which allows you to do this right out of the box! Java Taglibs provide autocompletion, but you need to write a lot of XML for that... In our approach, all the definitions for autocompletion are automatically generated.
That's a feature which really thrills me, as this will make learning the template engine a breeze if you have a XML editor which uses XML Schema information (such as eclipse).
We want to create a simple, extensible, robust and flexible template engine, which has everything you might need, but nothing more as well! Besides, we want to give you all the tools to make working with it as easy as possible (Autocompletion, wizards, ...).
So, to me, it's "templating how it should be" - all the things you need, but nothing more. Something of beauty and ease. Fun to use.
We are currently discussing details of the template engine on the mailing lists, so please join if you have some ideas ready!
Besides, I think now it is the right time to build up a small team around it. So, if you want to join, just contact me or write on the mailing lists!
As I had a lot of positive feedback so far, both from v4 and v5 developers, my plan is to first build the templating engine for v5, and afterwards, backport it to TYPO3 v4 as well. If all goes well, we might have a really cool templating solution in TYPO3 4.4! But I need your help for that :-)
Greets from Dresden, Germany,
Sebastian
I would suggest to review one more engine http://dwoo.org/. Besides the features explained on the home page I can say, that the source code of the engine itself is pretty clean so maybe it will be a source for architectural ideas.