Controller/FormController.php
public function renderFormAction(RequestStack $requestStack, string $formUuid, string $template = null, array $defaultData): Response
    {
        $request = $requestStack->getMasterRequest();
        $handledRequest = $this->formService->handleRequest($request, $formUuid, $defaultData);

        // Get the forms template.
        $baseTemplate = $handledRequest['template'] ?? '@forms/Frontend/form.html.twig';
        $template = $template ?: $baseTemplate;

        foreach ($handledRequest['messages'] as $message) {
            $this->addFlash(
                $message['type'],
                $message['message']
            );
        }

        return $this->render($template, [
            'form' => $handledRequest['formView'],
            'request' => $request,
            'ignore_validation' => $handledRequest['ignore_validation'],
        ]);
    }
public function renderFormAction(RequestStack $requestStack, string $formUuid, string $template = null, array $defaultData): Response
    {
        $request = $requestStack->getMasterRequest();
        $handledRequest = $this->formService->handleRequest($request, $formUuid, $defaultData);

        // Get the forms template.
        $baseTemplate = $handledRequest['template'] ?? '@forms/Frontend/form.html.twig';
        $template = $template ?: $baseTemplate;

        foreach ($handledRequest['messages'] as $message) {
            $this->addFlash(
                $message['type'],
                $message['message']
            );
        }

        return $this->render($template, [
            'form' => $handledRequest['formView'],
            'request' => $request,
            'ignore_validation' => $handledRequest['ignore_validation'],
        ]);
    }
@param RequestStack           $requestStack
@param string                 $formUuid
@param string|null            $template
@param array                  $defaultData

@return Response