You are here

function devel_generate_menu_links_discovered_alter in Devel 8

Same name and namespace in other branches
  1. 8.3 devel_generate/devel_generate.module \devel_generate_menu_links_discovered_alter()
  2. 8.2 devel_generate/devel_generate.module \devel_generate_menu_links_discovered_alter()
  3. 4.x devel_generate/devel_generate.module \devel_generate_menu_links_discovered_alter()

Implements hook_menu_links_discovered_alter().

File

devel_generate/devel_generate.module, line 13

Code

function devel_generate_menu_links_discovered_alter(&$links) {
  $devel_generate_plugins = $devel_generate_manager = \Drupal::service('plugin.manager.develgenerate')
    ->getDefinitions();
  foreach ($devel_generate_plugins as $id => $plugin) {
    $label = $plugin['label'];
    $links["devel_generate.{$id}"] = array(
      'title' => "Generate {$label}",
      'parent' => 'system.admin_config_development',
      'description' => $plugin['description'],
      'route_name' => "devel_generate.{$id}",
    );
  }
}