[FLOW3-general] TYPO3.Form using RedirectFinisher with post

Bastian Waidelich bastian at typo3.org
Mon Aug 13 09:22:41 CEST 2012


Robin Lehrmann wrote:

Hi Robin,

>> even easier is to persist the article
>> in the form factory (have a look at the closure finisher).
>> With that, you won't need create & update actions any longer..

> Can you explain how I can use the closure finisher ?

Maybe that helps: https://gist.github.com/3130147
This is a custom form factory you can inherit from in order to work with 
models more easily (this might become part of TYPO3.Form core in a 
slightly modified version). It takes care of adding validation & 
property mapping rules, too.

If you only want to use the closure finisher, try:

$this->formDefinition->createFinisher('TYPO3.Form:Closure')->setOption('closure', 
function(\TYPO3\Form\Core\Model\FinisherContext $context) use 
($articleRepository) {
	$formValues = $context->getFormValues();
	$article = ...
	$articleRepository->add($article;
});

HTH

-- 
Bastian Waidelich
TYPO3 Core Team Member

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the FLOW3-general mailing list