protected function MediaRouteProvider::getCanonicalRoute in Drupal 10
Same name and namespace in other branches
- 8 core/modules/media/src/Routing/MediaRouteProvider.php \Drupal\media\Routing\MediaRouteProvider::getCanonicalRoute()
- 9 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\RoutingCode
protected function getCanonicalRoute(EntityTypeInterface $entity_type) {
if ($this->config
->get('standalone_url')) {
return parent::getCanonicalRoute($entity_type);
}
else {
return parent::getEditFormRoute($entity_type);
}
}