[TYPO3-english] Sum up in for/each-loop

Jigal van Hemert jigal.van.hemert at typo3.org
Wed Oct 12 15:32:38 CEST 2016


Hi,

On 11/10/2016 15:04, Jeppe Donslund wrote:
> In a for/each-loop in fluid I am calculating difference between to
> timestamps.
> I would like to add these differences through the loop.
> How is that possible?

This should be done outside fluid. You could process the data in your 
controller and add a variable to the view that contains the sum (and 
preferably also the differences).
In TYPO3 7 the FLUIDTEMPLATE object supports dataProcessors to iterate 
over the data, do calculations and add the result in a new variable for 
use in fluid.

-- 
Jigal van Hemert
TYPO3 CMS Active Contributor

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the TYPO3-english mailing list