public function onFormSuccess(FormEvent $event)
    {
        $form = $event->getForm();

        $result = $this->createResult($form);

        if ($form->getStoreResults()) {
            $this->storeResult($form, $result);
        }

        if ($form->getSendMail()) {
            $this->sendMail($form, $result);
        }

        $successUrl = $form->getSuccessUrl();

        if ($successUrl != null) {
            $redirectResponse = new RedirectResponse($successUrl);
            $redirectResponse->send();
        }
    }
public function onFormSuccess(FormEvent $event)
    {
        $form = $event->getForm();

        $result = $this->createResult($form);

        if ($form->getStoreResults()) {
            $this->storeResult($form, $result);
        }

        if ($form->getSendMail()) {
            $this->sendMail($form, $result);
        }

        $successUrl = $form->getSuccessUrl();

        if ($successUrl != null) {
            $redirectResponse = new RedirectResponse($successUrl);
            $redirectResponse->send();
        }
    }
public function onFormSuccess ( FormEvent $ event ) { $ form = $ event -> getForm ( ) ; $ result = $ this -> createResult ( $ form ) ; if ( $ form -> getStoreResults ( ) ) { $ this -> storeResult ( $ form , $ result ) ; } if ( $ form -> getSendMail ( ) ) { $ this -> sendMail ( $ form , $ result ) ; } $ successUrl = $ form -> getSuccessUrl ( ) ; if ( $ successUrl != null ) { $ redirectResponse = new RedirectResponse ( $ successUrl ) ; $ redirectResponse -> send ( ) ; } }
Default handling for the form success event. This includes storage of
the result, sending a confirmation mail and redirecting to the success
URL, while respecting the form settings.

@param FormEvent $event
Default handling for the form success event . This includes storage of the result sending a confirmation mail and redirecting to the success URL while respecting the form settings .