class RouteSubscriber in Varbase Total Control Dashboard 8
Same name and namespace in other branches
- 8.6 src/Routing/RouteSubscriber.php \Drupal\varbase_total_control\Routing\RouteSubscriber
- 8.5 src/Routing/RouteSubscriber.php \Drupal\varbase_total_control\Routing\RouteSubscriber
- 9.0.x src/Routing/RouteSubscriber.php \Drupal\varbase_total_control\Routing\RouteSubscriber
Listens to the dynamic route events.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\varbase_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\varbase_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-panels_variant-0')) {
$route
->setRequirement('_permission', 'have total control');
}
if ($route = $collection
->get('page_manager.page_view_total_control_dashboard_total_control_dashboard-panels_variant-1')) {
$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 |