public function LayoutPluginManager::getThemeImplementations in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Layout/LayoutPluginManager.php \Drupal\Core\Layout\LayoutPluginManager::getThemeImplementations()
- 9 core/lib/Drupal/Core/Layout/LayoutPluginManager.php \Drupal\Core\Layout\LayoutPluginManager::getThemeImplementations()
Gets theme implementations for layouts.
Return value
array An associative array of the same format as returned by hook_theme().
Overrides LayoutPluginManagerInterface::getThemeImplementations
See also
File
- core/
lib/ Drupal/ Core/ Layout/ LayoutPluginManager.php, line 162
Class
- LayoutPluginManager
- Provides a plugin manager for layouts.
Namespace
Drupal\Core\LayoutCode
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;
}