You are here

protected function Routes::getEntryPointRoute in Drupal 9

Same name and namespace in other branches
  1. 8 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 366

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;
}