[FLOW3-general] (FLUID) Assemble TagBasedViewHelper manually

Michael Sauter mail at michaelsauter.net
Mon Feb 8 20:48:46 CET 2010


On 04.02.10 18:03, Martin Kutschker wrote:
> Michael Sauter schrieb:
>>
>> One other idea came to my mind: Maybe it would be better to introduce
>> new nodes when parsing the template, not when rendering it. E.g. after
>> parsing a ViewHelper, calling a method in it that can inject new nodes
>> into the object tree. What do you think ... or is this idea crap? ;)
>
> You mean a two step process?
>
> Step 1: parsing the template creates a node tree. Normally nodes will be created from the elements
> (tags) found in the template but can be injected during the process or afterwards.
>
> Step 2: walking the tree renders the output.

Yeah that was my idea ... but I realized it's not going to work that way :(

... because Fluid lets you write custom code in ViewHelpers, not in 
nodes. But at the time of parsing, there are no ViewHelpers yet, so 
there is no way of calling your code. That means that if the 
"Node/ViewHelper generation" code is placed in the ViewHelper, it can 
only be called during the rendering process (that's what I tried first) 
... at least that's what I gathered so far, please correct me if I'm 
wrong ;)

Anyone ideas what else could work?





More information about the FLOW3-general mailing list