function MainContentViewSubscriber::__construct
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php \Drupal\Core\EventSubscriber\MainContentViewSubscriber::__construct()
- 10 core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php \Drupal\Core\EventSubscriber\MainContentViewSubscriber::__construct()
- 9 core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php \Drupal\Core\EventSubscriber\MainContentViewSubscriber::__construct()
- 8.9.x core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php \Drupal\Core\EventSubscriber\MainContentViewSubscriber::__construct()
Constructs a new MainContentViewSubscriber object.
Parameters
\Drupal\Core\Routing\RouteMatchInterface $routeMatch: The current route match.
\Symfony\Component\DependencyInjection\ServiceLocator $renderers: A service locator that contains the main content renderer services, keyed by the 'format' attribute.
File
-
core/
lib/ Drupal/ Core/ EventSubscriber/ MainContentViewSubscriber.php, line 43
Class
- MainContentViewSubscriber
- View subscriber rendering main content render arrays into responses.
Namespace
Drupal\Core\EventSubscriberCode
public function __construct(protected RouteMatchInterface $routeMatch, #[AutowireLocator('render.main_content_renderer', 'format')] protected ServiceLocator $renderers) {
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.