[TYPO3-english] TS: is there a way to count() for elements GP-variable?
Loek Hilgersom
loek at netcoop.nl
Sun Nov 30 22:38:42 CET 2014
Hi Bert,
Two solutions I can think of:
1. (complicated) doing something with split and adding 1 for each rendered instance
2. (easy) using a simple userFunc with just this:
return count(explode(',', $inputValue));
Hth,
Loek
On 30-11-14 18:37, Bert Hiddink [BENDOO e-work solutions] wrote:
> Hello,
>
> I have a variable like this:
>
> &setOfIds=23,56,234,5,77
>
> I receive this Get-var within TS like:
> {GP:setOfIds}
>
> However, is there a way to count the amount of separated elements with this var,
> something like "count({GP:setOfIds})" ?
>
> The result should be "5" in this example...
>
> Thanks in advance!
>
> Regards,
> Bert
More information about the TYPO3-english
mailing list