You are here

class EntityTestRoutes in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php \Drupal\entity_test\Routing\EntityTestRoutes

Subscriber for Entity Test routes.

Hierarchy

Expanded class hierarchy of EntityTestRoutes

File

core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php, line 15
Contains \Drupal\entity_test\Routing\EntityTestRoutes.

Namespace

Drupal\entity_test\Routing
View source
class EntityTestRoutes {

  /**
   * Returns an array of route objects.
   *
   * @return \Symfony\Component\Routing\Route[]
   *   An array of route objects.
   */
  public function routes() {
    $types = entity_test_entity_types(ENTITY_TEST_TYPES_ROUTING);
    $types[] = 'entity_test_string_id';
    $types[] = 'entity_test_no_id';
    $routes = array();
    foreach ($types as $entity_type_id) {
      $routes["entity.{$entity_type_id}.add_form"] = new Route("{$entity_type_id}/add", array(
        '_controller' => '\\Drupal\\entity_test\\Controller\\EntityTestController::testAdd',
        'entity_type_id' => $entity_type_id,
      ), array(
        '_permission' => 'administer entity_test content',
      ));
      $routes["entity.{$entity_type_id}.admin_form"] = new Route("{$entity_type_id}/structure/{bundle}", array(
        '_controller' => '\\Drupal\\entity_test\\Controller\\EntityTestController::testAdmin',
      ), array(
        '_permission' => 'administer entity_test content',
      ), array(
        '_admin_route' => TRUE,
      ));
    }
    return $routes;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityTestRoutes::routes public function Returns an array of route objects.