class CacheflushRouteSubscriber in CacheFlush 8
A route subscriber to remove routes that depend on modules being enabled.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\cacheflush_ui\Routing\CacheflushRouteSubscriber
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\RoutingView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheflushRouteSubscriber:: |
protected | function |
Alters existing routes for a specific collection. Overrides RouteSubscriberBase:: |
|
RouteSubscriberBase:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | 5 |
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |