RouteSubscriber.php in Automatic IP ban (Autoban) 8
File
modules/autoban_dblog/src/Routing/RouteSubscriber.php
View source
<?php
namespace Drupal\autoban_dblog\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Drupal\Core\Routing\RoutingEvents;
use Symfony\Component\Routing\RouteCollection;
class RouteSubscriber extends RouteSubscriberBase {
public static function getSubscribedEvents() {
$events[RoutingEvents::ALTER] = [
'onAlterRoutes',
-176,
];
return $events;
}
public function alterRoutes(RouteCollection $collection) {
if ($route = $collection
->get('dblog.overview')) {
$route
->setDefault('_controller', '\\Drupal\\autoban_dblog\\Controller\\AutobanDbLogController::overview');
}
}
}