Services/FormService.php
public function getForm(string $formUuid, $data = null, bool $ignore_validation = false): FormInterface
    {
        /** @var FormRead $formRead */
        $formRead = $this->entityManager->getRepository(FormRead::class)->findOneBy(['uuid' => $formUuid]);
        $payload = $formRead->getPayload();

        $formName = strtolower(preg_replace('/[^A-Za-z0-9]/', '', $formRead->getTitle()));
        if (empty($formName)) {
            $formName = $formRead->getUuid();
        }

        $formOptions = [
            'action' => '?formular=abgeschickt',
            'validation_groups' => !$ignore_validation,
        ];

        $formBuilder = $this->formFactory->createNamedBuilder($formName, FormType::class, $data, $formOptions);

        foreach ($payload['items'] as $item) {
            $itemClass = $this->getItemClass($item['itemName']);

            if (method_exists($itemClass, 'getItem')) {
                $itemClass::getItem($formBuilder, $item['data']);
            }
        }

        return $formBuilder->getForm();
    }
public function getForm(string $formUuid, $data = null, bool $ignore_validation = false): FormInterface
    {
        /** @var FormRead $formRead */
        $formRead = $this->entityManager->getRepository(FormRead::class)->findOneBy(['uuid' => $formUuid]);
        $payload = $formRead->getPayload();

        $formName = strtolower(preg_replace('/[^A-Za-z0-9]/', '', $formRead->getTitle()));
        if (empty($formName)) {
            $formName = $formRead->getUuid();
        }

        $formOptions = [
            'action' => '?formular=abgeschickt',
            'validation_groups' => !$ignore_validation,
        ];

        $formBuilder = $this->formFactory->createNamedBuilder($formName, FormType::class, $data, $formOptions);

        foreach ($payload['items'] as $item) {
            $itemClass = $this->getItemClass($item['itemName']);

            if (method_exists($itemClass, 'getItem')) {
                $itemClass::getItem($formBuilder, $item['data']);
            }
        }

        return $formBuilder->getForm();
    }
@param string $formUuid
@param null   $data
@param bool   $ignore_validation

@return FormInterface