public function RouteSubscriber::alterRoutes in Display Suite 8.2
Same name in this branch
- 8.2 src/Routing/RouteSubscriber.php \Drupal\ds\Routing\RouteSubscriber::alterRoutes()
- 8.2 modules/ds_devel/src/Routing/RouteSubscriber.php \Drupal\ds_devel\Routing\RouteSubscriber::alterRoutes()
- 8.2 modules/ds_extras/src/EventSubscriber/RouteSubscriber.php \Drupal\ds_extras\EventSubscriber\RouteSubscriber::alterRoutes()
Same name and namespace in other branches
- 8.4 modules/ds_extras/src/EventSubscriber/RouteSubscriber.php \Drupal\ds_extras\EventSubscriber\RouteSubscriber::alterRoutes()
- 8.3 modules/ds_extras/src/EventSubscriber/RouteSubscriber.php \Drupal\ds_extras\EventSubscriber\RouteSubscriber::alterRoutes()
Alters the routes.
Parameters
\Drupal\Core\Routing\RouteBuildEvent $event: The event to process.
File
- modules/
ds_extras/ src/ EventSubscriber/ RouteSubscriber.php, line 28
Class
- RouteSubscriber
- Alter the node view route.
Namespace
Drupal\ds_extras\EventSubscriberCode
public function alterRoutes(RouteBuildEvent $event) {
if (\Drupal::config('ds_extras.settings')
->get('override_node_revision')) {
$route = $event
->getRouteCollection()
->get('entity.node.revision');
if (!empty($route)) {
$route
->setDefault('_controller', '\\Drupal\\ds_extras\\Controller\\DsExtrasController::revisionShow');
}
}
}