You are here

public function BlockPluginTrait::submitConfigurationForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Block/BlockPluginTrait.php \Drupal\Core\Block\BlockPluginTrait::submitConfigurationForm()
  2. 10 core/lib/Drupal/Core/Block/BlockPluginTrait.php \Drupal\Core\Block\BlockPluginTrait::submitConfigurationForm()

Most block plugins should not override this method. To add submission handling for a specific block type, override BlockBase::blockSubmit().

See also

\Drupal\Core\Block\BlockBase::blockSubmit()

File

core/lib/Drupal/Core/Block/BlockPluginTrait.php, line 221

Class

BlockPluginTrait
Provides the base implementation of a block plugin.

Namespace

Drupal\Core\Block

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {

  // Process the block's submission handling if no errors occurred only.
  if (!$form_state
    ->getErrors()) {
    $this->configuration['label'] = $form_state
      ->getValue('label');
    $this->configuration['label_display'] = $form_state
      ->getValue('label_display');
    $this->configuration['provider'] = $form_state
      ->getValue('provider');
    $this
      ->blockSubmit($form, $form_state);
  }
}