You are here

protected function MediaRouteProvider::getCanonicalRoute in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/media/src/Routing/MediaRouteProvider.php \Drupal\media\Routing\MediaRouteProvider::getCanonicalRoute()

Gets the canonical route.

Parameters

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

Return value

\Symfony\Component\Routing\Route|null The generated route, if available.

Overrides DefaultHtmlRouteProvider::getCanonicalRoute

File

core/modules/media/src/Routing/MediaRouteProvider.php, line 46

Class

MediaRouteProvider
Provides HTML routes for media pages.

Namespace

Drupal\media\Routing

Code

protected function getCanonicalRoute(EntityTypeInterface $entity_type) {
  if ($this->config
    ->get('standalone_url')) {
    return parent::getCanonicalRoute($entity_type);
  }
  else {
    return parent::getEditFormRoute($entity_type);
  }
}