function MediaRouteProvider::getCanonicalRoute

Same name in other branches
  1. 9 core/modules/media/src/Routing/MediaRouteProvider.php \Drupal\media\Routing\MediaRouteProvider::getCanonicalRoute()
  2. 8.9.x core/modules/media/src/Routing/MediaRouteProvider.php \Drupal\media\Routing\MediaRouteProvider::getCanonicalRoute()
  3. 11.x core/modules/media/src/Routing/MediaRouteProvider.php \Drupal\media\Routing\MediaRouteProvider::getCanonicalRoute()

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);
    }
}

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