class RouteSubscriber in Total Control Admin Dashboard 8.2
Same name and namespace in other branches
- 3.0.x src/Routing/RouteSubscriber.php \Drupal\total_control\Routing\RouteSubscriber
Listens to the dynamic route events.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\total_control\Routing\RouteSubscriber
Expanded class hierarchy of RouteSubscriber
1 string reference to 'RouteSubscriber'
1 service uses RouteSubscriber
File
- src/
Routing/ RouteSubscriber.php, line 12
Namespace
Drupal\total_control\RoutingView source
class RouteSubscriber extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
protected function alterRoutes(RouteCollection $collection) {
if ($route = $collection
->get('page_manager.page_view_total_control_dashboard_total_control_dashboard-http_status_code-0')) {
$route
->setRequirement('_permission', 'have total control');
}
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
// Run after PageManagerRoutesAlterSubscriber.
$events[RoutingEvents::ALTER][] = [
'onAlterRoutes',
-170,
];
return $events;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RouteSubscriber:: |
protected | function |
Alters existing routes for a specific collection. Overrides RouteSubscriberBase:: |
|
RouteSubscriber:: |
public static | function |
Returns an array of event names this subscriber wants to listen to. Overrides RouteSubscriberBase:: |
|
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |