function EntityTestRoutes::routes

Same name in other branches
  1. 8.9.x core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php \Drupal\entity_test\Routing\EntityTestRoutes::routes()
  2. 10 core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php \Drupal\entity_test\Routing\EntityTestRoutes::routes()
  3. 11.x core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php \Drupal\entity_test\Routing\EntityTestRoutes::routes()

Returns an array of route objects.

Return value

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

1 string reference to 'EntityTestRoutes::routes'
entity_test.routing.yml in core/modules/system/tests/modules/entity_test/entity_test.routing.yml
core/modules/system/tests/modules/entity_test/entity_test.routing.yml

File

core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php, line 18

Class

EntityTestRoutes
Subscriber for Entity Test routes.

Namespace

Drupal\entity_test\Routing

Code

public function routes() {
    $types = entity_test_entity_types(ENTITY_TEST_TYPES_ROUTING);
    $routes = [];
    foreach ($types as $entity_type_id) {
        $routes["entity.{$entity_type_id}.admin_form"] = new Route("{$entity_type_id}/structure/{bundle}", [
            '_controller' => '\\Drupal\\entity_test\\Controller\\EntityTestController::testAdmin',
        ], [
            '_permission' => 'administer entity_test content',
        ], [
            '_admin_route' => TRUE,
        ]);
    }
    return $routes;
}

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