Drupal 8  8.0.2
PluginFormInterface Interface Reference
Inheritance diagram for PluginFormInterface:

Public Member Functions

 buildConfigurationForm (array $form, FormStateInterface $form_state)
 
 validateConfigurationForm (array &$form, FormStateInterface $form_state)
 
 submitConfigurationForm (array &$form, FormStateInterface $form_state)
 

Detailed Description

Provides an interface for an embeddable plugin form.

Member Function Documentation

buildConfigurationForm ( array  $form,
FormStateInterface  $form_state 
)

Form constructor.

Plugin forms are embedded in other forms. In order to know where the plugin form is located in the parent form, #parents and #array_parents must be known, but these are not available during the initial build phase. In order to have these properties available when building the plugin form's elements, let this method return a form element that has a #process callback and build the rest of the form in the callback. By the time the callback is executed, the element's #parents and #array_parents properties will have been set by the form API. For more documentation on #parents and #array_parents, see .

Parameters
array$formAn associative array containing the initial structure of the plugin form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.
Returns
array The form structure.

Implemented in EmailAction, BlockBase, GotoAction, ViewsBlockBase, VariantBase, DefaultSelection, MenuLinkDefaultForm, ViewsSelection, MessageAction, TestToolkit, SearchExtraTypeSearch, UserSelection, RotateImageEffect, TestProcessor, Language, ResizeImageEffect, ScaleImageEffect, ConvertImageEffect, ChangeUserRoleBase, CropImageEffect, ConditionPluginBase, TermSelection, ViewsMenuLinkForm, UserRole, and Broken.

submitConfigurationForm ( array &  $form,
FormStateInterface  $form_state 
)

Form submission handler.

Parameters
array$formAn associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.

Implemented in DefaultSelection, BlockBase, EmailAction, MenuLinkDefaultForm, ViewsSelection, GotoAction, VariantBase, RotateImageEffect, TestToolkit, SearchExtraTypeSearch, MessageAction, TestProcessor, Language, ScaleImageEffect, ResizeImageEffect, CropImageEffect, ConvertImageEffect, ChangeUserRoleBase, ConditionPluginBase, UserRole, Broken, and ConfigurableImageEffectBase.

validateConfigurationForm ( array &  $form,
FormStateInterface  $form_state 
)

Form validation handler.

Parameters
array$formAn associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.

Implemented in DefaultSelection, BlockBase, EmailAction, MenuLinkDefaultForm, ViewsSelection, VariantBase, RotateImageEffect, TestToolkit, ScaleImageEffect, ImageToolkitBase, ConditionPluginBase, ConfigurableActionBase, Broken, and ConfigurableImageEffectBase.


The documentation for this interface was generated from the following file: