You are here

class CacheflushRouteSubscriber in CacheFlush 8

A route subscriber to remove routes that depend on modules being enabled.

Hierarchy

Expanded class hierarchy of CacheflushRouteSubscriber

1 string reference to 'CacheflushRouteSubscriber'
cacheflush_ui.services.yml in modules/cacheflush_ui/cacheflush_ui.services.yml
modules/cacheflush_ui/cacheflush_ui.services.yml
1 service uses CacheflushRouteSubscriber
cacheflush.route_subscriber in modules/cacheflush_ui/cacheflush_ui.services.yml
Drupal\cacheflush_ui\Routing\CacheflushRouteSubscriber

File

modules/cacheflush_ui/src/Routing/CacheflushRouteSubscriber.php, line 11

Namespace

Drupal\cacheflush_ui\Routing
View source
class CacheflushRouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    if ($route = $collection
      ->get('cacheflush.presets.clear_id')) {
      $route
        ->setRequirement('_entity_access', 'cacheflush.clear');
      $collection
        ->add('cacheflush.presets.clear_id', $route);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheflushRouteSubscriber::alterRoutes protected function Alters existing routes for a specific collection. Overrides RouteSubscriberBase::alterRoutes
RouteSubscriberBase::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 5
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1