function LocaleDefaultConfigStorage::getComponentNames
Same name in other branches
- 9 core/modules/locale/src/LocaleDefaultConfigStorage.php \Drupal\locale\LocaleDefaultConfigStorage::getComponentNames()
- 8.9.x core/modules/locale/src/LocaleDefaultConfigStorage.php \Drupal\locale\LocaleDefaultConfigStorage::getComponentNames()
- 11.x core/modules/locale/src/LocaleDefaultConfigStorage.php \Drupal\locale\LocaleDefaultConfigStorage::getComponentNames()
Get all configuration names and folders for a list of modules or themes.
Parameters
string $type: Type of components: 'module' | 'theme' | 'profile'
array $list: Array of theme or module names.
Return value
array Configuration names provided by that component. In case of language module this list is extended with configured languages that have predefined names as well.
File
-
core/
modules/ locale/ src/ LocaleDefaultConfigStorage.php, line 129
Class
- LocaleDefaultConfigStorage
- Provides access to default configuration for locale integration.
Namespace
Drupal\localeCode
public function getComponentNames($type, array $list) {
$names = array_unique(array_merge(array_keys($this->requiredInstallStorage
->getComponentNames($list)), array_keys($this->optionalInstallStorage
->getComponentNames($list))));
if ($type == 'module' && in_array('language', $list)) {
$languages = $this->predefinedConfiguredLanguages();
$names = array_unique(array_merge($names, $languages));
}
return $names;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.