function CacheRouterRebuildSubscriber::getSubscribedEvents

Same name in other branches
  1. 9 core/lib/Drupal/Core/EventSubscriber/CacheRouterRebuildSubscriber.php \Drupal\Core\EventSubscriber\CacheRouterRebuildSubscriber::getSubscribedEvents()
  2. 8.9.x core/lib/Drupal/Core/EventSubscriber/CacheRouterRebuildSubscriber.php \Drupal\Core\EventSubscriber\CacheRouterRebuildSubscriber::getSubscribedEvents()
  3. 10 core/lib/Drupal/Core/EventSubscriber/CacheRouterRebuildSubscriber.php \Drupal\Core\EventSubscriber\CacheRouterRebuildSubscriber::getSubscribedEvents()

File

core/lib/Drupal/Core/EventSubscriber/CacheRouterRebuildSubscriber.php, line 26

Class

CacheRouterRebuildSubscriber
Clear cache tags when the router is rebuilt.

Namespace

Drupal\Core\EventSubscriber

Code

public static function getSubscribedEvents() : array {
    $events = [];
    // Act only when the router rebuild is finished.
    $events[RoutingEvents::FINISHED][] = [
        'onRouterFinished',
        200,
    ];
    return $events;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.