interface MainContentRendererInterface (View source)

The interface for "main content" (@code _controller @endcode) renderers.

Classes implementing this interface are able to render the main content (as received from controllers) into a response of a certain format (HTML, JSON …) and/or in a certain decorated manner (e.g. in the case of the default HTML main content renderer: with a page display variant applied).

Methods

Response
renderResponse(array $main_content, Request $request, RouteMatchInterface $route_match)

Renders the main content render array into a response.

Details

Response renderResponse(array $main_content, Request $request, RouteMatchInterface $route_match)

Renders the main content render array into a response.

Parameters

array $main_content

The render array representing the main content.

Request $request

The request object, for context.

RouteMatchInterface $route_match

The route match, for context.

Return Value

Response

The Response in the format that this implementation supports.