You are here

public function ConfigSubscriber::onConfigSave in Menu Link Weight 8

Same name and namespace in other branches
  1. 8.2 src/EventSubscriber/ConfigSubscriber.php \Drupal\menu_link_weight\EventSubscriber\ConfigSubscriber::onConfigSave()

Causes the container to be rebuilt on the next request.

Parameters

ConfigCrudEvent $event: The configuration event.

File

src/EventSubscriber/ConfigSubscriber.php, line 35

Class

ConfigSubscriber

Namespace

Drupal\menu_link_weight\EventSubscriber

Code

public function onConfigSave(ConfigCrudEvent $event) {
  $saved_config = $event
    ->getConfig();
  if ($saved_config
    ->getName() == 'menu_link_weight.settings' && $event
    ->isChanged('menu_parent_form_selector')) {
    $this->kernel
      ->invalidateContainer();
  }
}