class RouteSubscriber in Automatic IP ban (Autoban) 8
Route alter.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\autoban_dblog\Routing\RouteSubscriber
Expanded class hierarchy of RouteSubscriber
1 string reference to 'RouteSubscriber'
- autoban_dblog.services.yml in modules/
autoban_dblog/ autoban_dblog.services.yml - modules/autoban_dblog/autoban_dblog.services.yml
1 service uses RouteSubscriber
- autoban_dblog.route_subscriber in modules/
autoban_dblog/ autoban_dblog.services.yml - Drupal\autoban_dblog\Routing\RouteSubscriber
File
- modules/
autoban_dblog/ src/ Routing/ RouteSubscriber.php, line 17 - Contains \Drupal\autoban_dblog\Routing\RouteSubscriber.
Namespace
Drupal\autoban_dblog\RoutingView source
class RouteSubscriber extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[RoutingEvents::ALTER] = [
'onAlterRoutes',
-176,
];
return $events;
}
/**
* {@inheritdoc}
*/
public function alterRoutes(RouteCollection $collection) {
// Change controller for '/admin/reports/dblog'.
if ($route = $collection
->get('dblog.overview')) {
$route
->setDefault('_controller', '\\Drupal\\autoban_dblog\\Controller\\AutobanDbLogController::overview');
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RouteSubscriber:: |
public | 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 |