Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ComponentPluginManager.php

function ComponentPluginManager::__construct

Constructs ComponentPluginManager object.

Parameters

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

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

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

\Drupal\Core\Config\ConfigFactoryInterface $configFactory: The configuration factory.

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

\Drupal\Core\Theme\ComponentNegotiator $componentNegotiator: The component negotiator.

\Drupal\Core\File\FileSystemInterface $fileSystem: The file system service.

\Drupal\Core\Theme\Component\SchemaCompatibilityChecker $compatibilityChecker: The compatibility checker.

\Drupal\Core\Theme\Component\ComponentValidator $componentValidator: The component validator.

string $appRoot: The application root.

Overrides DefaultPluginManager::__construct

File

core/lib/Drupal/Core/Theme/ComponentPluginManager.php, line 64

Class

ComponentPluginManager
Defines a plugin manager to deal with components.

Namespace

Drupal\Core\Theme

Code

public function __construct(ModuleHandlerInterface $module_handler, ThemeHandlerInterface $themeHandler, CacheBackendInterface $cacheBackend, ConfigFactoryInterface $configFactory, ThemeManagerInterface $themeManager, ComponentNegotiator $componentNegotiator, FileSystemInterface $fileSystem, SchemaCompatibilityChecker $compatibilityChecker, ComponentValidator $componentValidator, string $appRoot) {
    // We are skipping the call to the parent constructor to avoid initializing
    // variables aimed for annotation discovery, that are unnecessary here.
    // Plugin managers using YAML discovery also skip the parent constructor,
    // like LinkRelationTypeManager.
    $this->moduleHandler = $module_handler;
    $this->factory = new ContainerFactory($this);
    $this->setCacheBackend($cacheBackend, 'component_plugins');
    // Note that we are intentionally skipping $this->alterInfo('component_info');
    // We want to ensure that everything related to a component is in the
    // single directory. If the alteration of a component is necessary,
    // component replacement is the preferred tool for that.
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal