W3cubDocs

/Drupal 8

public function ThemeHandler::install

public ThemeHandler::install(array $theme_list, $install_dependencies = TRUE)

Installs a given list of themes.

Parameters

array $theme_list: An array of theme names.

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 value

bool Whether any of the given themes have been installed.

Throws

\Drupal\Core\Extension\ExtensionNameLengthException Thrown when the theme name is to long.

Overrides ThemeHandlerInterface::install

Deprecated

in Drupal 8.0.x-dev and will be removed before Drupal 9.0.0. Use the theme_installer service instead.

See also

\Drupal\Core\Extension\ThemeInstallerInterface::install

File

core/lib/Drupal/Core/Extension/ThemeHandler.php, line 161

Class

ThemeHandler
Default theme handler using the config system to store installation statuses.

Namespace

Drupal\Core\Extension

Code

public function install(array $theme_list, $install_dependencies = TRUE) {
  // We keep the old install() method as BC layer but redirect directly to the
  // theme installer.
  return \Drupal::service('theme_installer')->install($theme_list, $install_dependencies);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Extension!ThemeHandler.php/function/ThemeHandler::install/8.1.x