function MediaRouteProvider::createInstance

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

Overrides DefaultHtmlRouteProvider::createInstance

File

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

Class

MediaRouteProvider
Provides HTML routes for media pages.

Namespace

Drupal\media\Routing

Code

public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) {
    return new static($container->get('entity_type.manager'), $container->get('entity_field.manager'), $container->get('config.factory'));
}

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