ToolbarThemeHooks.php

Namespace

Drupal\toolbar\Hook

File

core/modules/toolbar/src/Hook/ToolbarThemeHooks.php

View source
<?php

namespace Drupal\toolbar\Hook;

use Drupal\Core\Hook\Attribute\Hook;

/**
 * Hook implementations for toolbar.
 */
class ToolbarThemeHooks {
  
  /**
   * Implements hook_preprocess_HOOK() for HTML document templates.
   */
  public function preprocessHtml(&$variables) : void {
    if (!\Drupal::currentUser()->hasPermission('access toolbar')) {
      return;
    }
    $variables['attributes']['class'][] = 'toolbar-loading';
  }

}

Classes

Title Deprecated Summary
ToolbarThemeHooks Hook implementations for toolbar.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.