function ConfigInstallerInterface::installDefaultConfig

Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/ConfigInstallerInterface.php \Drupal\Core\Config\ConfigInstallerInterface::installDefaultConfig()
  2. 10 core/lib/Drupal/Core/Config/ConfigInstallerInterface.php \Drupal\Core\Config\ConfigInstallerInterface::installDefaultConfig()
  3. 11.x core/lib/Drupal/Core/Config/ConfigInstallerInterface.php \Drupal\Core\Config\ConfigInstallerInterface::installDefaultConfig()

Installs the default configuration of a given extension.

When an extension is installed, it searches all the default configuration directories for all other extensions to locate any configuration with its name prefix. For example, the Node module provides the frontpage view as a default configuration file: core/modules/node/config/install/views.view.frontpage.yml When the Views module is installed after the Node module is already enabled, the frontpage view will be installed.

Additionally, the default configuration directory for the extension being installed is searched to discover if it contains default configuration that is owned by other enabled extensions. So, the frontpage view will also be installed when the Node module is installed after Views.

Parameters

string $type: The extension type; e.g., 'module' or 'theme'.

string $name: The name of the module or theme to install default configuration for.

See also

\Drupal\Core\Config\ExtensionInstallStorage

2 methods override ConfigInstallerInterface::installDefaultConfig()
ConfigInstaller::installDefaultConfig in core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php
Installs the default configuration of a given extension.
ConfigInstaller::installDefaultConfig in core/lib/Drupal/Core/Config/ConfigInstaller.php
Installs the default configuration of a given extension.

File

core/lib/Drupal/Core/Config/ConfigInstallerInterface.php, line 33

Class

ConfigInstallerInterface
Interface for classes that install config.

Namespace

Drupal\Core\Config

Code

public function installDefaultConfig($type, $name);

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