You are here

public function LayoutPluginManager::getThemeImplementations in Layout Plugin (obsolete, use core's Layout Discovery) 8

Get theme implementations for layouts that give only a template.

Return value

array An associative array of the same format as returned by hook_theme().

Overrides LayoutPluginManagerInterface::getThemeImplementations

See also

hook_theme()

File

src/Plugin/Layout/LayoutPluginManager.php, line 157

Class

LayoutPluginManager
Plugin type manager for all layouts.

Namespace

Drupal\layout_plugin\Plugin\Layout

Code

public function getThemeImplementations() {
  $plugins = $this
    ->getDefinitions();
  $theme_registry = [];
  foreach ($plugins as $id => $definition) {
    if (!empty($definition['template']) && !empty($definition['theme'])) {
      $theme_registry[$definition['theme']] = [
        'render element' => 'content',
        'template' => $definition['template'],
        'path' => $definition['template_path'],
      ];
    }
  }
  return $theme_registry;
}