function ElementInfoManager::getInfo

Same name in other branches
  1. 9 core/lib/Drupal/Core/Render/ElementInfoManager.php \Drupal\Core\Render\ElementInfoManager::getInfo()
  2. 8.9.x core/lib/Drupal/Core/Render/ElementInfoManager.php \Drupal\Core\Render\ElementInfoManager::getInfo()
  3. 11.x core/lib/Drupal/Core/Render/ElementInfoManager.php \Drupal\Core\Render\ElementInfoManager::getInfo()
1 call to ElementInfoManager::getInfo()
ElementInfoManager::getInfoProperty in core/lib/Drupal/Core/Render/ElementInfoManager.php

File

core/lib/Drupal/Core/Render/ElementInfoManager.php, line 89

Class

ElementInfoManager
Provides a plugin manager for element plugins.

Namespace

Drupal\Core\Render

Code

public function getInfo($type) {
    $theme_name = $this->themeManager
        ->getActiveTheme()
        ->getName();
    if (!isset($this->elementInfo[$theme_name])) {
        $this->elementInfo[$theme_name] = $this->buildInfo($theme_name);
    }
    $info = $this->elementInfo[$theme_name][$type] ?? [];
    $info['#defaults_loaded'] = TRUE;
    return $info;
}

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