[TYPO3-mvc] access to ChildNodes arguments

Christian Zenker christian.zenker at 599media.de
Wed Jul 29 10:32:32 CEST 2009


Hi.

I was trying to write a Switch-Case-ViewHelper yesterday. Should look  
something like that:

<x:switch by="foobar">
	<x:case label="foo">...</x:case>
	<x:case label="bar">...</x:case>
	<x:default>...</x:default>
</x:switch>

I tried to do it like the IfViewHelper does it: having a look at each  
children and rendering them if necessary. But I need to access the  
label-argument of the children. I added a getArguments() to the  
ViewHelperNode (sorry for editing the core :) ), but couldn't evaluate()  
the returned rootNode, as there was no renderingContext. Is there any way  
around it?

Temporarily i solved it using the viewHelperVariableContainer, but I don't  
think that this is a good or durable solution. The first one would be the  
cleaner one.

Ideas and help are appreciated.

Christian


More information about the TYPO3-project-typo3v4mvc mailing list