[TYPO3-core] RFC #17420: Add LOOP cObject
Xavier Perseguers
typo3 at perseguers.ch
Tue Feb 1 18:50:59 CET 2011
Hi,
JoH asenau wrote:
>> 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.
>
> +1
>
> I already discussed that with Xavier and my proposal was to use "input"
> and make it stdWrap aware, so that we can still add Array-related
> functions to the stdWrap toolbox that could be used by "input" later on.
>
> The current approach without input would be doing it the other way
> around, so that LOOP would only be useful when called by the PHP code of
> an extension.
Actually "input" is already supported by the proposed RFC (it may still
be named "data" but latest version of the patch has it as "input" anyway).
Problem as spotted by Ernesto is that stdWrap toolbox does not support
returning arrays but once it's done the proposed LOOP cobj is working as
intended.
Still, there were interesting proposals in the dev list but we should
have clear use cases before wanting to implement some real beast just
for the pleasure of making it fully configurable. My use case, which is
the same as Dmitry's is clear, often plugins would like to loop over
arbitrary array of data. Having a way to dynamically create arrays in TS
or do other fancy stuff may be great but we should first have a list of
somehow real use cases.
Xavier
More information about the TYPO3-team-core
mailing list