function devel_generate_menu_links_discovered_alter

Same name in other branches
  1. 4.x devel_generate/devel_generate.module \devel_generate_menu_links_discovered_alter()
  2. 5.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}",
        );
    }
}