[TYPO3-team-core-v5] Templating Engine

Bastian Waidelich bastian at typo3.org
Wed Oct 22 10:27:47 CEST 2008


Sebastian Gebhard wrote:

Hi Sebastian,

> to be honest at first I was not very happy to read about 
> a new template engine [...]

I gotta add some words about how we came up with the idea of writing a 
new template engine in the first place:
We are not keen to invent yet another templating engine (nor to justify 
this decision to the community).
That's why we extensively checked a lot of existing solutions in the 
last few weeks.
Because templating will be very deeply integrated in FLOW3 and TYPO3v5 
(in the core modules as well as in own packages and plugins) we had to 
be quite critical to prevent building on shifting ground.
Until now we couldn't find a templating engine which completely 
fulfilled our needs. Either the code base was error-prone, dated or 
incomplete or it couldn't be integrated very well cause helpers (also 
called plugins or modifiers) were called in a global scope without any 
context (which makes it really hard to use an engine in a 
multi-plugin-architecture).

Having said that, I'd like to emphasize again that nothing is decided 
yet and we're simply evaluating our possibilities. So if you know a PHP 
based template engine you are really convinced of, don't hesitate to 
post a suggestion here!


> because it's one more thing on the big list of "What you have to 
> learn to get from traditional TYPO3 Extensions to FLOW3 Packages".

As Sebastian wrote, we're trying to implement the new templating engine 
(whatever it will be) in TYPO3v4 so the learning curve won't be too 
steep here.

> Why don't you nest parameters as tags into the containing tag:
> 
> <f3:link:to>
>     <f3:param name="controller">posts</f3:param>
>     <f3:param name="action">editPost</f3:param>
>     <f3:array name="requestParameters>
>         <f3:index name="postId>{post.id}</f3:index>
>     </f3:array>
>     <f3:content>Edit post</f3:content>
> </f3:link:to>

Yes, we definitely thought about a similar syntax, as that is actually 
the way lots of XML-based markup languages handle complex properties. 
Anyways, in my opinion there should be a shorter way to add a link. 
Right now you could write it like this:

<f3:link:to controller="posts" action="editPost" arguments:postId=" 
{post.id}>Edit post</f3:link:to>

Though you could leave out the controller argument if the current view 
belongs to the same controller.

But yeah, we might have to support the more extensive syntax too 
(especially when it comes to multi-dimensional parameters)


> By the way: Is BEER3 someting like a development name or are you serious 
> with that? Is there a deeper meaning behind that or is it just beer?

BEER stands for Best Engineered Engine Replacement.. and that's 
obviously just a temporary name we saucily nicked from here 
http://buzz.typo3.org/people/robert-lemke/article/unknown3/ because we 
couldn't come up with a better name yet ;)


Regarding the support of multiple templating engines: Sure it will be 
possible to use your own templating system when you write a package. And 
already now there exists a Smarty package and a PHPTAL package.. But 
obviously we're planning to find a solution good enough that everyone 
wants to use it so that we don't have to deal with lots of different 
techniques again..

Bastian


More information about the TYPO3-team-core-v5 mailing list