You are here

protected function WebformShareRouteSubscriber::alterRoutes in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_share/src/Routing/WebformShareRouteSubscriber.php \Drupal\webform_share\Routing\WebformShareRouteSubscriber::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_share/src/Routing/WebformShareRouteSubscriber.php, line 34

Class

WebformShareRouteSubscriber
Remove webform share routes.

Namespace

Drupal\webform_share\Routing

Code

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