You are here

private function EckRoutes::createListRoute in Entity Construction Kit (ECK) 8

Creates the listing route.

Parameters

string $entityTypeId: The entity type id.

string $entityTypeLabel: The entity type label.

Return value

\Symfony\Component\Routing\Route The created listing route.

1 call to EckRoutes::createListRoute()
EckRoutes::routes in src/Routing/EckRoutes.php

File

src/Routing/EckRoutes.php, line 47

Class

EckRoutes
Defines dynamic routes.

Namespace

Drupal\eck\Routing

Code

private function createListRoute($entityTypeId, $entityTypeLabel) {
  $path = "admin/content/{$entityTypeId}";
  $defaults = [
    '_entity_list' => $entityTypeId,
    '_title' => '%type content',
    '_title_arguments' => [
      '%type' => ucfirst($entityTypeLabel),
    ],
  ];
  $permissions = [
    "access {$entityTypeId} entity listing",
    "bypass eck entity access",
  ];
  $requirements = [
    '_permission' => implode('+', $permissions),
  ];
  return new Route($path, $defaults, $requirements);
}