Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. toolbar.module

function toolbar_preprocess_html

Implements hook_preprocess_HOOK() for HTML document templates.

File

core/modules/toolbar/toolbar.module, line 123

Code

function toolbar_preprocess_html(&$variables) : void {
    if (!\Drupal::currentUser()->hasPermission('access toolbar')) {
        return;
    }
    $variables['attributes']['class'][] = 'toolbar-loading';
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal