622a403dad5324a5a27f0c5d6db9423ffef95fd8
[yaffs-website] / web / core / modules / system / tests / modules / link_generation_test / link_generation_test.module
1 <?php
2
3 /**
4  * @file
5  * Helper module for the link generation tests.
6  */
7
8 /**
9  * Implements hook_link_alter().
10  */
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']]);
16     }
17     else {
18       $variables['text'] .= ' <strong>Test!</strong>';
19     }
20   }
21 }