class AjaxRenderer implements MainContentRendererInterface (View source)

Default main content renderer for Ajax requests.

Properties

protected ElementInfoManagerInterface $elementInfoManager

The element info manager.

protected RendererInterface $renderer

The renderer.

Methods

__construct(ElementInfoManagerInterface $element_info_manager, RendererInterface $renderer = NULL)

Constructs a new AjaxRenderer instance.

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

Renders the main content render array into a response.

drupalRenderRoot($elements) deprecated

Wraps \Drupal\Core\Render\RendererInterface::renderRoot().

Details

__construct(ElementInfoManagerInterface $element_info_manager, RendererInterface $renderer = NULL)

Constructs a new AjaxRenderer instance.

Parameters

ElementInfoManagerInterface $element_info_manager

The element info manager.

RendererInterface $renderer

The renderer.

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.

protected drupalRenderRoot($elements) deprecated

deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Use $this->renderer->renderRoot() instead.

Wraps \Drupal\Core\Render\RendererInterface::renderRoot().

Parameters

$elements

See also

https://www.drupal.org/node/2912696