function MenuLinksetRoutes::alterRoutes
Alter routes.
If the endpoint is configured to be enabled, dynamically enable all authentication providers on this module's routes since they cannot be known in advance.
Parameters
\Symfony\Component\Routing\RouteCollection $collection: A collection of routes.
Overrides RouteSubscriberBase::alterRoutes
File
-
core/
modules/ system/ src/ Routing/ MenuLinksetRoutes.php, line 51
Class
- MenuLinksetRoutes
- Dynamically defines routes for menu linkset endpoints.
Namespace
Drupal\system\RoutingCode
public function alterRoutes(RouteCollection $collection) {
if ($this->configFactory
->get('system.feature_flags')
->get('linkset_endpoint')) {
$collection->get('system.menu.linkset')
->setOption('_auth', $this->providerIds);
}
}