Drupal 8  8.0.2
MainContentViewSubscriber Class Reference
Inheritance diagram for MainContentViewSubscriber:

Public Member Functions

 __construct (ClassResolverInterface $class_resolver, RouteMatchInterface $route_match, array $main_content_renderers)
 
 onViewRenderArray (GetResponseForControllerResultEvent $event)
 

Static Public Member Functions

static getSubscribedEvents ()
 

Data Fields

const WRAPPER_FORMAT = '_wrapper_format'
 

Protected Attributes

 $classResolver
 
 $routeMatch
 
 $mainContentRenderers
 

Detailed Description

View subscriber rendering main content render arrays into responses.

Additional target rendering formats can be defined by adding another service that implements and tagging it as a

render.main_content_renderer

, then will detect it and use it when appropriate.

See Also

Constructor & Destructor Documentation

__construct ( ClassResolverInterface  $class_resolver,
RouteMatchInterface  $route_match,
array  $main_content_renderers 
)

Constructs a new MainContentViewSubscriber object.

Parameters
\Drupal\Core\DependencyInjection\ClassResolverInterface$class_resolverThe class resolver service.
\Drupal\Core\Routing\RouteMatchInterface$route_matchThe current route match.
array$main_content_renderersThe available main content renderer service IDs, keyed by format.

References Drupal\routeMatch().

Here is the call graph for this function:

Member Function Documentation

static getSubscribedEvents ( )
static

{}

onViewRenderArray ( GetResponseForControllerResultEvent  $event)

Sets a response given a (main content) render array.

Parameters
\Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent$eventThe event to process.

References Drupal\routeMatch().

Here is the call graph for this function:

Field Documentation


The documentation for this class was generated from the following file: