Task #8732

Small improvement of ForViewHelper

Added by Michael Feinbier about 5 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2010-07-08
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:ViewHelpers
Target version:-
Has patch:

Description

In the Tx_Fluid_ViewHelpers_ForViewHelper there's a method convertToArray() which extracts an array from the traversable object via foreach.
This should be replaced by the function iterator_to_array() which does basically the same but more performant on huge objects than foreach'ing manually.

Patches for v4 and v5 branch are attached.

typo3v4_fluid_iterator_improvement.patch Magnifier (1.1 kB) Michael Feinbier, 2010-07-08 09:10

flow3_fluid_iterator_improvement.patch Magnifier (1.1 kB) Michael Feinbier, 2010-07-08 09:10

Associated revisions

Revision bc55efa4
Added by Bastian Waidelich about 5 years ago

[~TASK] Fluid (ViewHelpers): Replaced custom convertToArray() method by PHPs iterator_to_array() function in cycle, for and groupedFor ViewHelpers. This resolves #8732. Thanks to Michael Feinbier!

Revision 7feab9f3
Added by Bastian Waidelich about 5 years ago

[+TASK] Fluid (ViewHelpers): Small performance improvement in ForViewHelper: Objects will only be converted to arrays if reverse is TRUE. Relates to #8732
[+TASK] Fluid (View): Added getter for template parser to AbstractTemplateView. This is useful if you want to use the parser from within your custom ViewHelper (creating a new instance would skip interceptor registration)

History

#1 Updated by Bastian Waidelich about 5 years ago

  • Status changed from New to Accepted

That's great, I didn't know that function. Thanks!

#2 Updated by Bastian Waidelich about 5 years ago

  • Tracker changed from Bug to Task

#3 Updated by Bastian Waidelich about 5 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r4898.

Also available in: Atom PDF