function ElementInfoManager::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Render/ElementInfoManager.php \Drupal\Core\Render\ElementInfoManager::__construct()
  2. 8.9.x core/lib/Drupal/Core/Render/ElementInfoManager.php \Drupal\Core\Render\ElementInfoManager::__construct()
  3. 10 core/lib/Drupal/Core/Render/ElementInfoManager.php \Drupal\Core\Render\ElementInfoManager::__construct()

Constructs an ElementInfoManager object.

Parameters

\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations.

\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use.

\Drupal\Core\Extension\ThemeHandlerInterface $themeHandler: The theme handler.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler to invoke the alter hook with.

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

Overrides DefaultPluginManager::__construct

File

core/lib/Drupal/Core/Render/ElementInfoManager.php, line 48

Class

ElementInfoManager
Provides a plugin manager for element plugins.

Namespace

Drupal\Core\Render

Code

public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ThemeHandlerInterface $themeHandler, ModuleHandlerInterface $module_handler, ThemeManagerInterface $themeManager) {
    $this->setCacheBackend($cache_backend, 'element_info');
    parent::__construct('Element', $namespaces, $module_handler, 'Drupal\\Core\\Render\\Element\\ElementInterface', RenderElement::class, 'Drupal\\Core\\Render\\Annotation\\RenderElement');
    $this->alterInfo('element_plugin');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.