[TYPO3-mvc] this-object in fluid

Christian Opitz christian.opitz at netzelf.de
Tue Oct 5 13:54:19 CEST 2010


Hi list,

i shortly had the idea of an this object in fluid views and i 
implemented in a quite basic way. With this first try I'm now able to 
access arguments of view-helpers with an ID:

<f:form.select options="{this.otherSelect.options}"/>
<f:form.select id="otherSelect" options="{bla:'blubb',hello:'world'}"/>

Further ways to use that could be to render form-helpers multiple times 
within one view, build view stacks, define private vars and declarations 
within a template and let viewHelpers interact with each other:

<f:label for="{this.textField}">Label</label>
<f:form.textfield property="bla" id="textField"/>
<!-- When bla has errors - result would be: -->
<label for="textField" class="error">Label</label>
<input type="text" name="object[bla]" id="textField" class="error"/>

That's just an idea - currently i can only access the attributes. Also 
there are some problems with nested elements and the attributes have to 
be evaluated everytime they are accessed which probably is not very 
performant. (Technically i extended the parser, pushed each element with 
an ID and it's attributes in a "document"-object and replaced the 
objectAccessors beginning with "this." with an thisAccessor which has 
access to the whole document)

So - since that idea is in my head for a while now and i could not get 
it out, i wanted to share it with you and ask for your oppinions..

Cheers,
Christian


More information about the TYPO3-project-typo3v4mvc mailing list