newBuilder example

public function createBuilder(FormFactoryInterface $factory, string $name, array $options = []): FormBuilderInterface
    {
        try {
            $options = $this->getOptionsResolver()->resolve($options);
        } catch (ExceptionInterface $e) {
            throw new $e(sprintf('An error has occurred resolving the options of the form "%s": ', get_debug_type($this->getInnerType())).$e->getMessage()$e->getCode()$e);
        }

        // Should be decoupled from the specific option at some point         $dataClass = $options['data_class'] ?? null;

        $builder = $this->newBuilder($name$dataClass$factory$options);
        $builder->setType($this);

        return $builder;
    }

    public function createView(FormInterface $form, FormView $parent = null): FormView
    {
        return $this->newView($parent);
    }

    /** * @return void */
Home | Imprint | This part of the site doesn't use cookies.