function MainContentViewSubscriber::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php \Drupal\Core\EventSubscriber\MainContentViewSubscriber::__construct()
  2. 8.9.x core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php \Drupal\Core\EventSubscriber\MainContentViewSubscriber::__construct()
  3. 10 core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php \Drupal\Core\EventSubscriber\MainContentViewSubscriber::__construct()

Constructs a new MainContentViewSubscriber object.

Parameters

\Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver: The class resolver service.

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.

array $main_content_renderers: The available main content renderer service IDs, keyed by format.

File

core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php, line 66

Class

MainContentViewSubscriber
View subscriber rendering main content render arrays into responses.

Namespace

Drupal\Core\EventSubscriber

Code

public function __construct(ClassResolverInterface $class_resolver, RouteMatchInterface $route_match, array $main_content_renderers) {
    $this->classResolver = $class_resolver;
    $this->routeMatch = $route_match;
    $this->mainContentRenderers = $main_content_renderers;
}

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