[TYPO3-mvc] Extbase Form with list of objects
Moritz Otto
moritz-otto at gmx.de
Mon Jul 13 15:24:25 CEST 2015
Hi,
I'm learning extbase at the moment and try to implent some features. :)
I try to have a form, that has n-objects of an object. When submitting the form I want to work with all of these objects.
For my understanding I could do the following code (but it does not work...)
index.html:
<div>
<f:layout name="Default"/>
<title>Templates: Index</title>
<f:section name="main">
<f:form action="save" name="save" name="players">
<f:for each="{players}" as="player" iteration="itarator">
{player.place}.
<f:form.textfield property="{itarator.index}.firstname" />
<f:form.textfield property="{itarator.index}.lastname" />
<f:form.textfield property="{itarator.index}.club" />
<br/>
</f:for>
<f:form.submit name="submit" value="Speichern" />
</f:form>
</f:section>
</div>
Submit-Controller:
/**
* action cform
* @param array $players
* @return void
*/
public function saveAction(array $players) {
}
All Players a of type player and a given by $this->view->assign('players', $players);
How its possible to add the "updated" player-List in saveAction?
Thanks and regards,
Moritz
More information about the TYPO3-project-typo3v4mvc
mailing list