You are here

public function BlockBase::submitConfigurationForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Block/BlockBase.php \Drupal\Core\Block\BlockBase::submitConfigurationForm()

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

Overrides PluginFormInterface::submitConfigurationForm

See also

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

File

core/lib/Drupal/Core/Block/BlockBase.php, line 224
Contains \Drupal\Core\Block\BlockBase.

Class

BlockBase
Defines a base block implementation that most blocks plugins will extend.

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);
  }
}