FluidTYPO3\Flux\Form\AbstractFormComponent::createComponent PHP Method

createComponent() public method

public createComponent ( string $namespace, string $type, string $name, string | null $label = NULL ) : FluidTYPO3\Flux\Form\FormInterface
$namespace string
$type string
$name string
$label string | null
return FluidTYPO3\Flux\Form\FormInterface
    public function createComponent($namespace, $type, $name, $label = NULL)
    {
        /** @var FormInterface $component */
        $className = $this->createComponentClassName($type, $namespace);
        $component = $this->getObjectManager()->get($className);
        if (NULL === $component->getName()) {
            $component->setName($name);
        }
        $component->setLabel($label);
        $component->setLocalLanguageFileRelativePath($this->getLocalLanguageFileRelativePath());
        $component->setDisableLocalLanguageLabels($this->getDisableLocalLanguageLabels());
        $component->setExtensionName($this->getExtensionName());
        return $component;
    }