[FLOW3-general] fluid - Create input fields from array
David Sporer
david.sporer at gmail.com
Sun Aug 12 22:22:34 CEST 2012
Hi,
I was able to resolve this - in case someone has the same question, here's
how I did it:
<f:for each="{array}" as="arrayEntry">
<label for="userDataArray[{arrayEntry.name}]">
{arrayEntry.name}
</label>
<br>
<f:form.textbox name=" userDataArray[{arrayEntry.name}]" />
<br>
</f:for>
And in my Action-Method in the Controller:
public function createAction($userDataArray){
$this->localArray = $userDataArray;
}
Regards
David
Am 05.08.2012 um 19:02 schrieb David Sporer <david.sporer at googlemail.com>:
> Hey guys,
>
>
>
> don't know if there's an example on the web but I haven't found one.
>
> I have an object that contains an array.
>
> I need to create a textfield in a form for every item in the array. The
> value of the original array should be the key in the new array and the value
> of the textfield should be the value in the new array.
>
> My first approach looks like this but I know it can't work.
>
> Could you help me out?
>
> <f:for each="{pass.keysToReplace}" as="replaceableKey">
>
> <label for="newPassInstance.user.userData">
>
> {replaceableKey.name}
>
> </label>
>
> <br>
>
> <f:form.textbox property="newPassInstance.user.userData"
> id="newPassInstance.user.userData" />
>
> <br>
>
> </f:for>
>
>
>
> Pass is the object that contains the keysToReplace array. In this array are
> replaceableKey objects that have a name property.
>
> newPassInstance is the object I want to create and user is a connected
> entity that has the userData array in it.
>
> My questions are now:
>
> 1. Is this possible? What other ways to do this are there?
>
> 2. How to do it? I can't even access the replacableKey.name - it
> simply shows nothing. But the keysToReplace array is there. It generates me
> two input fields on the created form.
>
>
>
> Thank you very much!
>
> David
>
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
More information about the FLOW3-general
mailing list