function BlockContentTypeRouteProvider::getRoutes

Overrides DefaultHtmlRouteProvider::getRoutes

File

core/modules/block_content/src/Routing/BlockContentTypeRouteProvider.php, line 18

Class

BlockContentTypeRouteProvider
Provides HTML routes for block_content_type entities.

Namespace

Drupal\block_content\Routing

Code

public function getRoutes(EntityTypeInterface $entity_type) {
  $routes = parent::getRoutes($entity_type);
  // Rename the entity.block_content_type.add_form route to keep BC.
  // @todo remove this and use an alias instead when https://www.drupal.org/project/drupal/issues/3506653 is done.
  $addFormRoute = $routes->get('entity.block_content_type.add_form');
  $routes->remove('entity.block_content_type.add_form');
  $routes->add('block_content.type_add', $addFormRoute);
  return $routes;
}

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