forked from a64f7bb4-7358-4778-9fbe-3b882c34cc1d/v1
12 lines
390 B
Twig
12 lines
390 B
Twig
/**
|
|
* Implements hook_link_alter().
|
|
*/
|
|
function {{ machine_name }}_link_alter(&$variables) {
|
|
// Add a warning to the end of route links to the admin section.
|
|
/** @var \Drupal\Core\Url $url */
|
|
$url = $variables['url'];
|
|
if ($url->isRouted() && strpos($url->getRouteName(), 'admin') !== FALSE) {
|
|
$variables['text'] = t('@text (Warning!)', ['@text' => $variables['text']]);
|
|
}
|
|
}
|