function BlockContentRouteProvider::getRoutes

Overrides DefaultHtmlRouteProvider::getRoutes

File

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

Class

BlockContentRouteProvider
Provides HTML routes for block_content entities.

Namespace

Drupal\block_content\Routing

Code

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

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