Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MenuLinksetRoutes.php

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\Routing

Code

public function alterRoutes(RouteCollection $collection) {
    if ($this->configFactory
        ->get('system.feature_flags')
        ->get('linkset_endpoint')) {
        $collection->get('system.menu.linkset')
            ->setOption('_auth', $this->providerIds);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal