function LayoutPluginManager::getThemeImplementations

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Layout/LayoutPluginManager.php \Drupal\Core\Layout\LayoutPluginManager::getThemeImplementations()
  2. 10 core/lib/Drupal/Core/Layout/LayoutPluginManager.php \Drupal\Core\Layout\LayoutPluginManager::getThemeImplementations()
  3. 11.x core/lib/Drupal/Core/Layout/LayoutPluginManager.php \Drupal\Core\Layout\LayoutPluginManager::getThemeImplementations()

Overrides LayoutPluginManagerInterface::getThemeImplementations

File

core/lib/Drupal/Core/Layout/LayoutPluginManager.php, line 162

Class

LayoutPluginManager
Provides a plugin manager for layouts.

Namespace

Drupal\Core\Layout

Code

public function getThemeImplementations() {
    $hooks = [];
    $hooks['layout'] = [
        'render element' => 'content',
    ];
    
    /** @var \Drupal\Core\Layout\LayoutDefinition[] $definitions */
    $definitions = $this->getDefinitions();
    foreach ($definitions as $definition) {
        if ($template = $definition->getTemplate()) {
            $hooks[$definition->getThemeHook()] = [
                'render element' => 'content',
                'base hook' => 'layout',
                'template' => $template,
                'path' => $definition->getTemplatePath(),
            ];
        }
    }
    return $hooks;
}

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