interface PluginFormInterface

You are here

Provides an interface for a plugin that contains a form.

Namespace

Drupal\Core\Plugin

Implemented by

Hierarchy

Expanded class hierarchy of PluginFormInterface

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
PluginFormInterface::buildConfigurationForm public function Form constructor.
PluginFormInterface::submitConfigurationForm public function Form submission handler.
PluginFormInterface::validateConfigurationForm public function Form validation handler.

File

core/lib/Drupal/Core/Plugin/PluginFormInterface.php, line 13
Contains \Drupal\Core\Plugin\PluginFormInterface.

View source
interface PluginFormInterface {

  /**
   * Form constructor.
   *
   * @param array $form
   *   An associative array containing the structure of the form.
   * @param array $form_state
   *   An associative array containing the current state of the form.
   *
   * @return array
   *   The form structure.
   */
  public function buildConfigurationForm(array $form, array &$form_state);

  /**
   * Form validation handler.
   *
   * @param array $form
   *   An associative array containing the structure of the form.
   * @param array $form_state
   *   An associative array containing the current state of the form.
   */
  public function validateConfigurationForm(array &$form, array &$form_state);

  /**
   * Form submission handler.
   *
   * To properly store submitted form values store them in $this->configuration.
   * @code
   *   $this->configuration['some_value'] = $form_state['values']['some_value'];
   * @endcode
   *
   * @param array $form
   *   An associative array containing the structure of the form.
   * @param array $form_state
   *   An associative array containing the current state of the form.
   */
  public function submitConfigurationForm(array &$form, array &$form_state);

}