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}
Easy solution found with f:alias
https://docs.typo3.org/typo3cms/ExtbaseGuide/Fluid/ViewHelper/Alias.html
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.