Feature #7389
GroupedForViewHelper group by object
Status: | Resolved | Start date: | 2010-04-20 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Bastian Waidelich | % Done: | 100% |
|
Category: | ViewHelpers | |||
Target version: | - | |||
Has patch: |
Description
Currently it is not possible to group by an object.
Example :
class Foo { /** @return array<Bar> */ public function getBars(); } class Bar { /** @return Baz */ public function getBaz(); } class Baz { }
Now, lets loop over them using the Baz objects as key.
<f:groupedFor each="{foo.bars}" as="bars" groupBy="baz" groupKey="baz"> {baz.title}: <ul> <f:for each="{bars}" as="bar"> <li>{bar.name}</li> </f:for> </ul> </f:groupedFor>
I expected output from this loop, something like
A crazy baz title: <ul> <li>A named bar</li> <li>Another named bar</li> </ul> Second crazy baz title: <ul> <li>A further named bar</li> <li>And yet another named bar</li> <li>The last named bar</li> </ul>
I got nothing. So I dug into this and created the attached patch, enabling the expected behavior.
Associated revisions
[+FEATURE] Fluid (ViewHelpers): Added URI options format, additionalParams, absolute, addQueryString & argumentsToBeExcludedFromQueryString to FormViewHelper. Resolves #8247
[+FEATURE] Fluid (ViewHelpers): GroupedForViewHelper can now group by object. Resolves #7389
[+FEATURE] Fluid (ViewHelpers): Added DebugViewHelper. Resolves #8468
History
#1 Updated by Bastian Waidelich about 5 years ago
- Project changed from Extbase MVC Framework to TYPO3.Fluid
#2 Updated by Bastian Waidelich about 5 years ago
- Category set to ViewHelpers
- Status changed from New to Accepted
- Assigned To set to Bastian Waidelich
- Priority changed from Could have to Should have
- Branch set to v4 + v5
Note: I just moved this issue from "Extbase MVC Framework" to "Fluid" - the patch is created against the v4 extension. I'll take care of this
#3 Updated by Bastian Waidelich about 5 years ago
- File 7389_v2_FLOW3.patch added
- File 7389_v2_typo3v4.patch added
- Status changed from Accepted to Needs Feedback
Can someone please double check the attached patches so they can be committed
#4 Updated by Bastian Waidelich about 5 years ago
- Status changed from Needs Feedback to Resolved
- % Done changed from 0 to 100
Applied in changeset r4620.