function Routes::getEntryPointRoute

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/src/Routing/Routes.php \Drupal\jsonapi\Routing\Routes::getEntryPointRoute()
  2. 10 core/modules/jsonapi/src/Routing/Routes.php \Drupal\jsonapi\Routing\Routes::getEntryPointRoute()
  3. 11.x core/modules/jsonapi/src/Routing/Routes.php \Drupal\jsonapi\Routing\Routes::getEntryPointRoute()

Provides the entry point route.

Parameters

string $path_prefix: The root path prefix.

Return value

\Symfony\Component\Routing\Route The entry point route.

1 call to Routes::getEntryPointRoute()
Routes::routes in core/modules/jsonapi/src/Routing/Routes.php

File

core/modules/jsonapi/src/Routing/Routes.php, line 365

Class

Routes
Defines dynamic routes.

Namespace

Drupal\jsonapi\Routing

Code

protected function getEntryPointRoute($path_prefix) {
    $entry_point = new Route("/{$path_prefix}");
    $entry_point->addDefaults([
        RouteObjectInterface::CONTROLLER_NAME => EntryPoint::class . '::index',
    ]);
    $entry_point->setRequirement('_access', 'TRUE');
    $entry_point->setMethods([
        'GET',
    ]);
    return $entry_point;
}

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