[TYPO3-core] RFC #17420: Add LOOP cObject

Ernesto Baschny [cron IT] ernst at cron-it.de
Tue Feb 1 18:02:56 CET 2011


Dmitry Dulepov schrieb am 01.02.2011 16:39:
> Hi!
> 
> Xavier Perseguers wrote:
>> Well, it works great even without "standard TYPO3" columns. I'm using
>> ->cObj->start() with any array content without problem :-).
> 
> +1. This is very useful for extensions that need to loop over custom
> data in templates (without uid).
> 
>>> Why not introduce a new ->dataArray which could be anything implementing
>>> the "Iterator" class? This allows much more flexible ways of passing
>>> data to this LOOP without having to "pre-fill" an array.
>>
>> Then it should not be named "dataArray" but "input" or "dataIterator"
>> because it would not be an array all the time.
> 
> I do not think it is necessary because it will complicate things. cObj
> works fine without using uid in $data. So leave it as is.

The trouble is that only "LOOP" knows this new syntax of "data"
(multi-valued array). So any other stdWrap method which tries to access
this stuff will choke (getData, field, ...). So I wouldn't put yet
another different semantic to the same array but instead use another one
which is then specifically known as an Iterator and not a "key-value"
array. It's annoying to have a same variable to have different semantics
depending on how you will use it.

Cheers,
Ernesto



More information about the TYPO3-team-core mailing list