abstract class PluginFormBase implements PluginFormInterface, PluginAwareInterface (View source)

Provides a base class for plugin forms.

Classes extending this can be in any namespace, but are commonly placed in the 'PluginForm' namespace, such as \Drupal\module_name\PluginForm\ClassName.

Properties

protected PluginInspectionInterface $plugin

The plugin this form is for.

Methods

setPlugin(PluginInspectionInterface $plugin)

Sets the plugin for this object.

validateConfigurationForm(array $form, FormStateInterface $form_state)

Form validation handler.

Details

setPlugin(PluginInspectionInterface $plugin)

Sets the plugin for this object.

Parameters

PluginInspectionInterface $plugin

The plugin.

validateConfigurationForm(array $form, FormStateInterface $form_state)

Form validation handler.

Parameters

array $form

An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().

FormStateInterface $form_state

The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().