Created
March 28, 2012 15:40
-
-
Save bwaidelich/2227439 to your computer and use it in GitHub Desktop.
Closure Finisher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
$closureFinisher = new \TYPO3\Form\Finishers\ClosureFinisher(); | |
$closureFinisher->setOption('closure', function($formRuntime) { | |
// $formRuntime->getFormState()->getFormValues(); | |
}); | |
$formDefinition->addFinisher($closureFinisher); | |
// ... | |
?> |
Reutilization of the person object created by the form in several finishers
class TestFactory extends \TYPO3\Form\Factory\AbstractFormFactory {
/**
* @param array $factorySpecificConfiguration
* @param $presetName
* @return \TYPO3\Form\Core\Model\FormDefinition
*/
public function build(array $factorySpecificConfiguration, $presetName) {
$formPersistenceManager = new \TYPO3\Form\Persistence\YamlPersistenceManager();
$formConfiguration = $formPersistenceManager->load('prueba');
$arrayFormFactory = new \TYPO3\Form\Factory\ArrayFormFactory();
$form = $arrayFormFactory->build($formConfiguration,$presetName);
$redirectFinisher = new \TYPO3\Form\Finishers\RedirectFinisher();
//idea code beguin
$personObject = objectbuilder($form->getFormRuntime()->getFormSubmittedValues())
$redirectFinisher->setOptions(
array('action' => 'confirmation',
'arguments' => array (
'Person' => $personObjecy
)
)
);
$otherFinisher->setOptions('person' => $personObject);
// idea code end
$form->addFinisher($redirectFinisher);
return $form;
}
}
?>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
where could I get the $formRuntime. Inside the formFactory?
could I add any key to $factorySpecificConfiguration ? for example