You are here

public function VocabularyRouteProvider::getRoutes in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/src/Entity/Routing/VocabularyRouteProvider.php \Drupal\taxonomy\Entity\Routing\VocabularyRouteProvider::getRoutes()

Provides routes for entities.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type

Return value

\Symfony\Component\Routing\RouteCollection|\Symfony\Component\Routing\Route[] Returns a route collection or an array of routes keyed by name, like route_callbacks inside 'routing.yml' files.

Overrides DefaultHtmlRouteProvider::getRoutes

File

core/modules/taxonomy/src/Entity/Routing/VocabularyRouteProvider.php, line 14

Class

VocabularyRouteProvider

Namespace

Drupal\taxonomy\Entity\Routing

Code

public function getRoutes(EntityTypeInterface $entity_type) {
  $collection = parent::getRoutes($entity_type);
  if ($reset_page_route = $this
    ->getResetPageRoute($entity_type)) {
    $collection
      ->add("entity.taxonomy_vocabulary.reset_form", $reset_page_route);
  }
  if ($overview_page_route = $this
    ->getOverviewPageRoute($entity_type)) {
    $collection
      ->add("entity.taxonomy_vocabulary.overview_form", $overview_page_route);
  }
  return $collection;
}