[FLOW3-general] Persist a TYPO3.Form to my own domain model
Bastian Waidelich
bastian at typo3.org
Tue Jul 17 17:44:49 CEST 2012
Søren Malling wrote:
Hi Søren
> Is it possible, using a form generated with TYPO3.Form, to map the
> submitted data to a argument in the controller->action which the
> finishers redirects to?
>
> Or, in some other way persist the submitted data as a object?
Finally I got round to this, sorry for the delay.
Ok, here's a slightly reduced version of an "AbstractModelFormFactory":
https://gist.github.com/3130147
I've put this into the TYPO3.Form namespace as I would like something
like this to be part of the package. But this is not yet fine tuned
enough and lacks documentation & tests. So feel free to add this to your
own package (don't forget to adjust the namespace).
The factory leaves the creation of form elements to you, but it
transparently adds default values and validators from your domain model.
The provided example shows how you can easily create create/edit forms
with one form factory now.
Let me know if something is not clear or if you have some ideas on how
to improve this.
Best,
--
Bastian Waidelich
TYPO3 Core Team Member
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the FLOW3-general
mailing list