X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fhook%2Flink_alter.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fhook%2Flink_alter.twig;h=f088b9cb48bb847d4a4775cb028b6e15cc46a408;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/link_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/link_alter.twig new file mode 100644 index 000000000..f088b9cb4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/link_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_link_alter(). + */ +function {{ machine_name }}_link_alter(&$variables) { + // Add a warning to the end of route links to the admin section. + if (isset($variables['route_name']) && strpos($variables['route_name'], 'admin') !== FALSE) { + $variables['text'] = t('@text (Warning!)', ['@text' => $variables['text']]); + } +}