ThemeInstaller
class ThemeInstaller implements ThemeInstallerInterface (View source)
Manages theme installation/uninstallation.
Traits
Messages for missing or incompatible dependencies on modules.
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.
Properties
| protected TranslationInterface | $stringTranslation | The string translation service. |
from StringTranslationTrait |
| protected ThemeHandlerInterface | $themeHandler | ||
| protected ConfigFactoryInterface | $configFactory | ||
| protected ConfigInstallerInterface | $configInstaller | ||
| protected ModuleHandlerInterface | $moduleHandler | ||
| protected StateInterface | $state | ||
| protected ConfigManagerInterface | $configManager | ||
| protected AssetCollectionOptimizerInterface | $cssCollectionOptimizer | ||
| protected RouteBuilderInterface | $routeBuilder | ||
| protected LoggerInterface | $logger | ||
| protected ModuleExtensionList | $moduleExtensionList | The module extension list. |
Methods
Provides messages for missing modules or incompatible dependencies.
Translates a string to the current language or to a given language.
Formats a string containing a count of items.
Returns the number of plurals supported by a given language.
Gets the string translation service.
Constructs a new ThemeInstaller.
Installs a given list of themes.
Uninstalls a given list of themes.
Resets some other systems like rebuilding the route information or caches.
Wraps drupal_theme_rebuild().
Details
string|null
checkDependencyMessage(array $modules, string $dependency, Dependency $dependency_object)
Provides messages for missing modules or incompatible dependencies.
protected TranslatableMarkup
t(string $string, array $args = [], array $options = [])
Translates a string to the current language or to a given language.
See \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() for important security information and usage guidelines.
In order for strings to be localized, make them available in one of the ways supported by the
protected
formatPlural($count, $singular, $plural, array $args = [], array $options = [])
Formats a string containing a count of items.
protected
getNumberOfPlurals($langcode = NULL)
Returns the number of plurals supported by a given language.
protected TranslationInterface
getStringTranslation()
Gets the string translation service.
$this
setStringTranslation(TranslationInterface $translation)
Sets the string translation service to use.
__construct(ThemeHandlerInterface $theme_handler, ConfigFactoryInterface $config_factory, ConfigInstallerInterface $config_installer, ModuleHandlerInterface $module_handler, ConfigManagerInterface $config_manager, AssetCollectionOptimizerInterface $css_collection_optimizer, RouteBuilderInterface $route_builder, LoggerInterface $logger, StateInterface $state, ModuleExtensionList $module_extension_list = NULL)
Constructs a new ThemeInstaller.
bool
install(array $theme_list, bool $install_dependencies = TRUE)
Installs a given list of themes.
uninstall(array $theme_list)
Uninstalls a given list of themes.
Uninstalling a theme removes all related configuration (like blocks) and invokes the 'themes_uninstalled' hook.
protected
resetSystem()
Resets some other systems like rebuilding the route information or caches.
protected
themeRegistryRebuild()
Wraps drupal_theme_rebuild().