function AssetResolver::__construct
Same name in other branches
- 9 core/lib/Drupal/Core/Asset/AssetResolver.php \Drupal\Core\Asset\AssetResolver::__construct()
- 8.9.x core/lib/Drupal/Core/Asset/AssetResolver.php \Drupal\Core\Asset\AssetResolver::__construct()
- 10 core/lib/Drupal/Core/Asset/AssetResolver.php \Drupal\Core\Asset\AssetResolver::__construct()
Constructs a new AssetResolver instance.
Parameters
\Drupal\Core\Asset\LibraryDiscoveryInterface $library_discovery: The library discovery service.
\Drupal\Core\Asset\LibraryDependencyResolverInterface $library_dependency_resolver: The library dependency resolver.
\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.
\Drupal\Core\Theme\ThemeManagerInterface $theme_manager: The theme manager.
\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.
\Drupal\Core\Cache\CacheBackendInterface $cache: The cache backend.
\Drupal\Core\Extension\ThemeHandlerInterface $theme_handler: The theme handler service.
File
-
core/
lib/ Drupal/ Core/ Asset/ AssetResolver.php, line 87
Class
- AssetResolver
- The default asset resolver.
Namespace
Drupal\Core\AssetCode
public function __construct(LibraryDiscoveryInterface $library_discovery, LibraryDependencyResolverInterface $library_dependency_resolver, ModuleHandlerInterface $module_handler, ThemeManagerInterface $theme_manager, LanguageManagerInterface $language_manager, CacheBackendInterface $cache, ?ThemeHandlerInterface $theme_handler = NULL) {
if ($theme_handler === NULL) {
@trigger_error('Calling ' . __METHOD__ . ' without the $theme_handler argument is deprecated in drupal:11.1.0 and it will be required in drupal:12.0.0. See https://www.drupal.org/project/drupal/issues/3451667', E_USER_DEPRECATED);
$theme_handler = \Drupal::service('theme_handler');
}
$this->libraryDiscovery = $library_discovery;
$this->libraryDependencyResolver = $library_dependency_resolver;
$this->moduleHandler = $module_handler;
$this->themeManager = $theme_manager;
$this->languageManager = $language_manager;
$this->cache = $cache;
$this->themeHandler = $theme_handler;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.