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