interface ThemeInstallerInterface

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Extension/ThemeInstallerInterface.php \Drupal\Core\Extension\ThemeInstallerInterface
  2. 10 core/lib/Drupal/Core/Extension/ThemeInstallerInterface.php \Drupal\Core\Extension\ThemeInstallerInterface
  3. 11.x core/lib/Drupal/Core/Extension/ThemeInstallerInterface.php \Drupal\Core\Extension\ThemeInstallerInterface

Manages theme installation/uninstallation.

Hierarchy

Expanded class hierarchy of ThemeInstallerInterface

All classes that implement ThemeInstallerInterface

3 files declare their use of ThemeInstallerInterface
TestSiteOliveroInstallTestScript.php in core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php
ThemeController.php in core/modules/system/src/Controller/ThemeController.php
ThemeExperimentalConfirmForm.php in core/modules/system/src/Form/ThemeExperimentalConfirmForm.php

File

core/lib/Drupal/Core/Extension/ThemeInstallerInterface.php, line 8

Namespace

Drupal\Core\Extension
View source
interface ThemeInstallerInterface {
    
    /**
     * Installs a given list of themes.
     *
     * @param array $theme_list
     *   An array of theme names.
     * @param bool $install_dependencies
     *   (optional) If TRUE, dependencies will automatically be installed in the
     *   correct order. This incurs a significant performance cost, so use FALSE
     *   if you know $theme_list is already complete and in the correct order.
     *
     * @return bool
     *   Whether any of the given themes have been installed.
     *
     * @throws \Drupal\Core\Extension\ExtensionNameLengthException
     *   Thrown when the theme name is to long.
     *
     * @throws \Drupal\Core\Extension\Exception\UnknownExtensionException
     *   Thrown when the theme does not exist.
     *
     * @throws \Drupal\Core\Extension\MissingDependencyException
     *   Thrown when a requested dependency can't be found.
     */
    public function install(array $theme_list, $install_dependencies = TRUE);
    
    /**
     * Uninstalls a given list of themes.
     *
     * Uninstalling a theme removes all related configuration (like blocks) and
     * invokes the 'themes_uninstalled' hook.
     *
     * @param array $theme_list
     *   The themes to uninstall.
     *
     * @throws \Drupal\Core\Extension\Exception\UnknownExtensionException
     *   Thrown when trying to uninstall a theme that was not installed.
     *
     * @throws \InvalidArgumentException
     *   Thrown when trying to uninstall the admin theme, the default theme or
     *   a theme that another theme depends on.
     *
     * @see hook_themes_uninstalled()
     */
    public function uninstall(array $theme_list);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
ThemeInstallerInterface::install public function Installs a given list of themes. 1
ThemeInstallerInterface::uninstall public function Uninstalls a given list of themes. 1

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