This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/web/core/themes/stable/stable.theme
2017-02-13 15:31:17 +00:00

26 lines
634 B
Plaintext

<?php
/**
* @file
* Functions to support theming in the Stable theme.
*/
use Drupal\Component\Utility\Html;
/**
* Implements template_preprocess_links().
*/
function stable_preprocess_links(&$variables) {
// @deprecated in Drupal 8.0.x and will be removed before 9.0.0. This feature
// of adding a class based on the associative key can cause CSS class name
// conflicts.
if (!empty($variables['links'])) {
foreach ($variables['links'] as $key => $value) {
if (!is_numeric($key)) {
$class = Html::getClass($key);
$variables['links'][$key]['attributes']->addClass($class);
}
}
}
}