[TYPO3-mvc] Using ViewHelpers inside ViewHelpers?
Nathan Lenz
typo3 at k9tfk.com
Tue Jan 19 17:40:59 CET 2010
David Schreiber wrote:
> Hello everybody,
>
> Is it possible to make use of a ViewHelper inside another ViewHelper?
>
> I have created a ViewHelper called category.render which renders a
> hierachical list of categories.
>
> These categories should be linked, and I would like to use the
> link.action ViewHelper inside my render method.
>
> Is there a way to achieve this? Or maybe evaluating the output of my
> rendered category again?
>
> Thank you,
> David Schreiber
Have you thought about using partials?
You could create a partial called "categoryList.html" and place it in
Resources/Private/Partials/. This partial can use any viewHelpers like
link.action.
Then you could add this to your template wherever you want to see the
hierarchical list of categories:
<f:render partial="categoryList" arguments="{categories: categories}" />
--Nathan
More information about the TYPO3-project-typo3v4mvc
mailing list