You are here

function drush_layout_plugin_list in Layout Plugin (obsolete, use core's Layout Discovery) 8

Create a basic template and configuration file for new Display Suite layout.

File

./layout_plugin.drush.inc, line 48
Drush integration.

Code

function drush_layout_plugin_list($name = NULL) {
  $layoutsManager = \Drupal::service('plugin.manager.layout_plugin');

  /** @var $layoutsManager \Drupal\layout_plugin\Plugin\Layout\LayoutPluginManager */
  $plugins = $layoutsManager
    ->getDefinitions();
  foreach ($plugins as $id => $pluginInfo) {
    $plugin = $layoutsManager
      ->createInstance($id, array());

    /** @var $plugin \Drupal\layout_plugin\Plugin\Layout\LayoutInterface */
    drush_print(dt('Layout !id: !regions', array(
      '!id' => $id,
      '!regions' => print_r($plugin
        ->getRegionNames(), TRUE),
    )));
  }
}