[TYPO3-core] RFC #17420: Add LOOP cObject
Xavier Perseguers
typo3 at perseguers.ch
Mon Jan 31 18:02:18 CET 2011
Hi,
>> 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.
What we should have then is yet another cObj "ARRAY" for instance which
would work a bit like a COA but would return a PHP array instead,
possibly supporting alternative input with some Iterator (if really
needed). This way, you could write something like that:
page.10 = LOOP
page.10.input = ARRAY
page.10.input {
10 = ARRAY_ITEM
10 {
firstKey = TEXT
firstKey.data = GP:foo
secondKey = 10
}
20 = ARRAY_ITEM
20 {
firstKey = 20
secondKey = 30
}
}
page.10.renderObj = COA
page.10.renderObj.10 = TEXT
page.10.renderObj.10.field = firstKey
page.10.renderObj.10.wrap = <strong>|:</strong>
page.10.renderObj.20 = TEXT
page.10.renderObj.20.field = secondKey
I wrote that quickly, it may be slightly different but for me this is
another (useful) RFC.
Xavier
More information about the TYPO3-team-core
mailing list