Commit 9c77c844 authored by Alexander Dubovskoy's avatar Alexander Dubovskoy

Update bone.theme

parent f6d95d16
......@@ -11,5 +11,23 @@ function bone_preprocess_html(&$variables) {
$path = \Drupal::request()->getPathInfo();
$path_args = explode('/', $path);
$variables['path_info']['args'] = Html::cleanCssIdentifier(ltrim($path, '/'));
}
/**
* Implements hook_preprocess() for disable debug in regions.
*/
function bone_preprocess(array &$variables, $hook) {
/** @var \Twig_Environment $twig_service */
$twig_service = \Drupal::service('twig');
$is_debug = drupal_static(__FUNCTION__, $twig_service->isDebug());
if ($is_debug) {
if ($hook == 'region') {
$twig_service->disableDebug();
}
else {
$twig_service->enableDebug();
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment