You are here

public function UltimenuBlock::blockSubmit in Ultimenu 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Block/UltimenuBlock.php \Drupal\ultimenu\Plugin\Block\UltimenuBlock::blockSubmit()

Overrides \Drupal\block\BlockBase::blockSubmit().

Overrides BlockPluginTrait::blockSubmit

File

src/Plugin/Block/UltimenuBlock.php, line 220

Class

UltimenuBlock
Provides an 'Ultimenu' block.

Namespace

Drupal\ultimenu\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  foreach (array_keys($this
    ->defaultConfiguration()) as $key) {
    $value = $form_state
      ->getValue($key);
    $this->configuration[$key] = $key == 'regions' ? array_filter($value) : $value;
  }

  // Invalidate the library discovery cache to update the new skin discovery.
  $this->ultimenuSkin
    ->clearCachedDefinitions();
  $this->libraryDiscovery
    ->clearCachedDefinitions();
}