You are here

protected function ComponentsInfo::init in Components! 8.2

Initializes the registry and loads the theme namespaces.

7 calls to ComponentsInfo::init()
ComponentsInfo::getAllModuleInfo in src/Template/ComponentsInfo.php
Retrieves the components info for all modules.
ComponentsInfo::getAllThemeInfo in src/Template/ComponentsInfo.php
Retrieves the components info for all themes.
ComponentsInfo::getModuleInfo in src/Template/ComponentsInfo.php
Retrieves the components info for the given module.
ComponentsInfo::getProtectedNamespaceExtensionInfo in src/Template/ComponentsInfo.php
Get info about the module/theme that owns the protected Twig namespace.
ComponentsInfo::getProtectedNamespaces in src/Template/ComponentsInfo.php
Returns a list of default namespaces that should not be overridden.

... See full list

File

src/Template/ComponentsInfo.php, line 115

Class

ComponentsInfo
Loads info about components defined in themes or modules.

Namespace

Drupal\components\Template

Code

protected function init() : void {
  if ($this->initialized) {
    return;
  }
  $this->initialized = TRUE;
  $this->moduleInfo = $this
    ->findComponentsInfo($this->moduleExtensionList);
  $this->themeInfo = $this
    ->findComponentsInfo($this->themeExtensionList);

  // Run hook_protected_twig_namespaces_alter().
  $this->moduleHandler
    ->alter('protected_twig_namespaces', $this->protectedNamespaces);
  $this->themeManager
    ->alter('protected_twig_namespaces', $this->protectedNamespaces);
}