Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SystemConfigSubscriber.php

function SystemConfigSubscriber::onConfigSave

Rebuilds the router when the default or admin theme is changed.

Parameters

\Drupal\Core\Config\ConfigCrudEvent $event: The configuration event.

File

core/modules/system/src/SystemConfigSubscriber.php, line 41

Class

SystemConfigSubscriber
System Config subscriber.

Namespace

Drupal\system

Code

public function onConfigSave(ConfigCrudEvent $event) {
    $saved_config = $event->getConfig();
    if ($saved_config->getName() == 'system.theme' && ($event->isChanged('admin') || $event->isChanged('default'))) {
        $this->routerBuilder
            ->setRebuildNeeded();
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal