Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / contextual_links_alter.twig
1 /**
2  * Implements hook_contextual_links_alter().
3  */
4 function {{ machine_name }}_contextual_links_alter(array &$links, $group, array $route_parameters) {
5   if ($group == 'menu') {
6     // Dynamically use the menu name for the title of the menu_edit contextual
7     // link.
8     $menu = \Drupal::entityManager()->getStorage('menu')->load($route_parameters['menu']);
9     $links['menu_edit']['title'] = t('Edit menu: @label', ['@label' => $menu->label()]);
10   }
11 }