protected function WebformCardsRouteSubscriber::alterRoutes in Webform 8.5
Same name and namespace in other branches
- 6.x modules/webform_cards/src/Routing/WebformCardsRouteSubscriber.php \Drupal\webform_cards\Routing\WebformCardsRouteSubscriber::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_cards/ src/ Routing/ WebformCardsRouteSubscriber.php, line 34
Class
- WebformCardsRouteSubscriber
- Remove webform cards routes.
Namespace
Drupal\webform_cards\RoutingCode
protected function alterRoutes(RouteCollection $collection) {
if (!$this->moduleHandler
->moduleExists('webform_ui')) {
$collection
->remove('entity.webform_ui.element.add_card');
}
}