W3cubDocs

/Drupal 8

public function ConfigInstallerInterface::installOptionalConfig

public ConfigInstallerInterface::installOptionalConfig(StorageInterface $storage = NULL, $dependency = [])

Installs optional configuration.

Optional configuration is only installed if:

  • the configuration does not exist already.
  • it's a configuration entity.
  • its dependencies can be met.

Parameters

\Drupal\Core\Config\StorageInterface: (optional) The configuration storage to search for optional configuration. If not provided, all enabled extension's optional configuration directories will be searched.

array $dependency: (optional) If set, ensures that the configuration being installed has this dependency. The format is dependency type as the key ('module', 'theme', or 'config') and the dependency name as the value ('book', 'bartik', 'views.view.frontpage').

File

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

Class

ConfigInstallerInterface
Interface for classes that install config.

Namespace

Drupal\Core\Config

Code

public function installOptionalConfig(StorageInterface $storage = NULL, $dependency = []);

© 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!Config!ConfigInstallerInterface.php/function/ConfigInstallerInterface::installOptionalConfig/8.1.x