AbstractFormFactory implements FormFactoryInterface

AbstractYes

Base class for custom *Form Factories*. A Form Factory is responsible for building a {@link TYPO3\CMS\Form\Domain\Model\FormDefinition}.

Example

Generally, you should use this class as follows:

class MyFooBarFactory extends AbstractFormFactory {
  public function build(array $configuration, $prototypeName) {
    $configurationService = GeneralUtility::makeInstance(ConfigurationService::class);
    $prototypeConfiguration = $configurationService->getPrototypeConfiguration($prototypeName);
    $formDefinition = GeneralUtility::makeInstance(FormDefinition::class, 'nameOfMyForm', $prototypeConfiguration);

    // now, you should call methods on $formDefinition to add pages and form elements

    return $formDefinition;
  }
}

Scope: frontend / backend This class is meant to be sub classed by developers.

Table of Contents

Interfaces

FormFactoryInterface
A Form Factory is responsible for building a {@link TYPO3\CMS\Form\Domain\Model\FormDefinition}.

Properties

$eventDispatcher  : EventDispatcherInterface|null

Methods

injectEventDispatcher()  : void
triggerFormBuildingFinished()  : FormDefinition

Properties

$eventDispatcher

protected EventDispatcherInterface|null $eventDispatcher = null

Methods

injectEventDispatcher()

public injectEventDispatcher(EventDispatcherInterface $eventDispatcher) : void
Parameters
$eventDispatcher : EventDispatcherInterface

        
On this page

Search results