Issue Feature Closed

#8963Input array handling

Mathias Bolt Lesniak 07/20/10, 15:32 updated 01/13/18, 00:43

Description

Hi!

I would really love it if stdWrap could handle input arrays too, not just strings. I posted about this on the TYPO3-english list earlier today and got a tip about this project. Here’s my post:

> Is it really impossible to somehow use array data from GET/POST in TypoScript? I can’t seem to find any way to get it to work.

> Here’s the issue:

> URL is: index.php?id=1&test[]=x&test[]=y&test[]=z

> How do I access the values of the “test” array without having to do “data = GP : test | 0”, “data = GP : test | 1”, etc. It won’t work if I don’t know the length of the array.

> I imagine two solutions, but neither exist today. The first one (below) is the easiest, but both require tslib_cobj->getText() to return arrays.

> h3. SOLUTION 1:

> (This doesn’t work because “data = GP : test” will return an empty string, since it sees the array.)

page.10 = TEXT
page.10.data = GP : test
#Implode the array so I can explode it with "split"
page.10.implode = ,
page.10.split {
  token = ,
  cObjNum = 1
  1 = TEXT
  1.current = 1
  1.wrap = <p>|</p>
}

> h3. SOLUTION 2:

>

#Using a new cObject which iterates arrays
page.10 = ITERATE
page.10.data = GP : test
page.10.1 = TEXT
page.10.1.current = 1
page.10.1.wrap = <p>|</p>

> The third solution would be to run everything though a custom USER function, but it’s much less flexible.

- Mathias

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.