You are here

protected function WebformOptionsLimitRouteSubscriber::alterRoutes in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_options_limit/src/Routing/WebformOptionsLimitRouteSubscriber.php \Drupal\webform_options_limit\Routing\WebformOptionsLimitRouteSubscriber::alterRoutes()

Alters existing routes for a specific collection.

Parameters

\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.

Overrides RouteSubscriberBase::alterRoutes

File

modules/webform_options_limit/src/Routing/WebformOptionsLimitRouteSubscriber.php, line 34

Class

WebformOptionsLimitRouteSubscriber
Remove webform options limit routes.

Namespace

Drupal\webform_options_limit\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  if (!$this->moduleHandler
    ->moduleExists('webform_node')) {
    $collection
      ->remove('entity.node.webform_options_limit.summary');
  }
}