You are here

function devel_menu_links_discovered_alter in Devel 8

Same name and namespace in other branches
  1. 8.3 devel.module \devel_menu_links_discovered_alter()
  2. 8.2 devel.module \devel_menu_links_discovered_alter()
  3. 4.x devel.module \devel_menu_links_discovered_alter()

Implements hook_menu_links_discovered_alter().

File

./devel.module, line 116
This module holds functions useful for Drupal development. Please contribute!

Code

function devel_menu_links_discovered_alter(&$links) {

  // Conditionally add the Layouts info menu link.
  if (\Drupal::moduleHandler()
    ->moduleExists('layout_discovery')) {
    $links['devel.layout_info'] = [
      'title' => new TranslatableMarkup('Layouts Info'),
      'route_name' => 'devel.layout_info',
      'description' => new TranslatableMarkup('Overview of layouts available to the site.'),
      'menu_name' => 'devel',
    ];
  }
}