BlockBase::submitConfigurationForm

public BlockBase::submitConfigurationForm(array &$form, FormStateInterface $form_state)

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 222

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);
  }
}
doc_Drupal
2016-10-29 08:46:37
Comments
Leave a Comment

Please login to continue.