W3cubDocs

/Drupal 8

public function 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 219

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Block!BlockBase.php/function/BlockBase::submitConfigurationForm/8.1.x