Adicionar classe ao corpo com base no caminho

<? php

/ **
* @file
* Funções para oferecer suporte a temas no tema personalizado.
* /

use Drupal Core Url;

/ **
* Implementa o pré-processamento do template html ().
* @param array $ variables
* /
function custom preprocess html (& $ variables) {
$ current path = Drupal :: service (‘path.current’) -> getPath ();
$ path
alias = Drupal :: service (‘path.alias manager’) -> getAliasByPath ($ current path);
$ path alias = ltrim ($ path alias, ‘/’);
$ variáveis ​​[‘atributos’] [‘classe’] [] = ‘caminho-‘. Drupal Component Utility Html :: cleanCssIdentifier ($ path_alias);
}
// kint ($ variables);
}