Skip to content

Added setFormSubmitProcessor to the HandlerConfigInterface

Compare
Choose a tag to compare
@yannickl88 yannickl88 released this 12 Oct 07:40
· 28 commits to master since this release

Added a way to apply a custom form submit processor to the handler if you require more fine-grained way to handle your form.

By default the ::handleRequest() is used, but if you need want to do something differently you can do that as follows:

public function configure(HandlerConfigInterface $config)
{
    $config->setFormSubmitProcessor(function (FormInterface $form, Request $request) {
        // taken from the Symfony docs example
        $form->submit($request->request->get($form->getName()));
    });
}

Example it take from the symfony docs: https://symfony.com/doc/current/form/direct_submit.html