W3cubDocs

/Drupal 8

public function Renderer::__construct

public Renderer::__construct(ControllerResolverInterface $controller_resolver, ThemeManagerInterface $theme, ElementInfoManagerInterface $element_info, PlaceholderGeneratorInterface $placeholder_generator, RenderCacheInterface $render_cache, RequestStack $request_stack, array $renderer_config)

Constructs a new Renderer.

Parameters

\Drupal\Core\Controller\ControllerResolverInterface $controller_resolver: The controller resolver.

\Drupal\Core\Theme\ThemeManagerInterface $theme: The theme manager.

\Drupal\Core\Render\ElementInfoManagerInterface $element_info: The element info.

\Drupal\Core\Render\PlaceholderGeneratorInterface $placeholder_generator: The placeholder generator.

\Drupal\Core\Render\RenderCacheInterface $render_cache: The render cache service.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

array $renderer_config: The renderer configuration array.

File

core/lib/Drupal/Core/Render/Renderer.php, line 111

Class

Renderer
Turns a render array into a HTML string.

Namespace

Drupal\Core\Render

Code

public function __construct(ControllerResolverInterface $controller_resolver, ThemeManagerInterface $theme, ElementInfoManagerInterface $element_info, PlaceholderGeneratorInterface $placeholder_generator, RenderCacheInterface $render_cache, RequestStack $request_stack, array $renderer_config) {
  $this->controllerResolver = $controller_resolver;
  $this->theme = $theme;
  $this->elementInfo = $element_info;
  $this->placeholderGenerator = $placeholder_generator;
  $this->renderCache = $render_cache;
  $this->rendererConfig = $renderer_config;
  $this->requestStack = $request_stack;

  // Initialize the context collection if needed.
  if (!isset(static::$contextCollection)) {
    static::$contextCollection = new \SplObjectStorage();
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!Renderer.php/function/Renderer::__construct/8.1.x