interface PluginFormFactoryInterface (View source)

Provides an interface for retrieving form objects for plugins.

This allows a plugin to define multiple forms, in addition to the plugin itself providing a form. All forms, decoupled or self-contained, must implement \Drupal\Core\Plugin\PluginFormInterface. Decoupled forms can implement \Drupal\Component\Plugin\PluginAwareInterface in order to gain access to the plugin.

Methods

createInstance(PluginWithFormsInterface $plugin, string $operation, string $fallback_operation = NULL)

Creates a new form instance.

Details

PluginFormInterface createInstance(PluginWithFormsInterface $plugin, string $operation, string $fallback_operation = NULL)

Creates a new form instance.

Parameters

PluginWithFormsInterface $plugin

The plugin the form is for.

string $operation

The name of the operation to use, e.g., 'add' or 'edit'.

string $fallback_operation

(optional) The name of the fallback operation to use.

Return Value

PluginFormInterface

A plugin form instance.

Exceptions

InvalidPluginDefinitionException