function MenuLinksetRoutes::routes

Same name and namespace in other branches
  1. 10 core/modules/system/src/Routing/MenuLinksetRoutes.php \Drupal\system\Routing\MenuLinksetRoutes::routes()

Returns an array of route objects.

Return value

\Symfony\Component\Routing\Route[] An array of route objects.

1 string reference to 'MenuLinksetRoutes::routes'
system.routing.yml in core/modules/system/system.routing.yml
core/modules/system/system.routing.yml

File

core/modules/system/src/Routing/MenuLinksetRoutes.php, line 94

Class

MenuLinksetRoutes
Dynamically defines routes for menu linkset endpoints.

Namespace

Drupal\system\Routing

Code

public function routes() {
    $routes = [];
    // Only enable linkset routes if the related config option is enabled.
    if ($this->configFactory
        ->get('system.feature_flags')
        ->get('linkset_endpoint')) {
        $routes['system.menu.linkset'] = new Route('/system/menu/{menu}/linkset', [
            '_controller' => 'Drupal\\system\\Controller\\LinksetController::process',
        ], [
            '_access' => 'TRUE',
        ], [
            'parameters' => [
                'menu' => [
                    'type' => 'entity:menu',
                ],
            ],
        ]);
    }
    return $routes;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.