5 * Helper module for the link generation tests.
9 * Implements hook_link_alter().
11 function link_generation_test_link_alter(&$variables) {
12 if (\Drupal::state()->get('link_generation_test_link_alter', FALSE)) {
13 // Add a text to the end of links.
14 if (\Drupal::state()->get('link_generation_test_link_alter_safe', FALSE)) {
15 $variables['text'] = t('@text <strong>Test!</strong>', ['@text' => $variables['text']]);
18 $variables['text'] .= ' <strong>Test!</strong>';