[TYPO3-mvc] f:for inside f:for ?

Sören Kracker s.kracker at kopfstand-mail.de
Wed Feb 15 17:04:24 CET 2012


It would be an ObjectStorage of the Logs.
You would define that in your model, e.g.:
     /**
      * logs
      *
      * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Abc_Domain_Model_Log>
      */

Am 15.02.2012 16:59, schrieb Stig Nørgaard Færch:
> Den 15-02-2012 16:16, Stefan Neufeind skrev:
>> On 02/15/2012 04:05 PM, Stig Nørgaard Færch wrote:
>>> I have a Log domain model linked to a Person domain model.
>>> So a Person can have multiple Logs attached.
>>>
>>> In the list view of the Person I would like to be able to fetch the
>>> belonging log entries.
>>> And it would be even better if I could decide which ones by a custom
>>> query. If not, I guess I could limit them by fluid ifs...
>>>
>>> But, I'm not sure exactly how to do this. Still newbie.
>>> But I did this - which doesn't work:
>>>
>>> **List.html:
>>> <f:for each="{persons}" as="person">
>>> <tr>
>>> <td><f:link.action action="show" arguments="{person : person}">
>>> {person.fullName}</f:link.action></td>
>>> <td>
>>> <f:for each="{person : logs}" as="log">
>>>                  {log.actionName}<br/>
>>> </f:for>
>>> </td>
>>> </tr>
>>> </f:for>
>>
>> I guess you meant to write
>>
>> <f:for each="{person.logs}" as="log">
>>
>> maybe? Is it the logs-property below a person-object?
>
> No - I guess not. I would describe it as the log-object connected to 
> the person-object (not sure how to describe it with the right terms :-)
>
> There can be any number of log records(? or should I say objects) for 
> each Person.
>
> If I used {person.logs} , wouldn't that just take a property of person?
>
> /Stig
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list