简体   繁体   中英

TYPO3 Escape Fluid ViewHelper object properties

I get back from a ViewHelper an object domain model 'post' in Fluid, by calling:

{p:lastPost(topic: topic)} or <p:lastPost topic="{topic}"/>

How do I access the properties in Fluid with this syntax?

Like name would normally be {lastPost.author.name}

And date {lastPost.crdate -> f:format.date(format: '%d %B %Y')}

If you are on TYPO3 >= Version 8 you can use the f:variable Viewhelper. f:alias works too, but is not as comfortable to use. For the variable ViewHelper you can use this syntax:

<f:variable name="myPostObject" value="{p:lastPost(topic: topic)}" />
{myPostObject.anyMemberVar}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM