function ThemeTestThemeHooks1::preprocessHtml
Implements hook_preprocess_HOOK() for HTML document templates.
Attributes
#[Hook('preprocess_html')]
File
-
core/
modules/ system/ tests/ modules/ theme_test/ src/ Hook/ ThemeTestThemeHooks1.php, line 17
Class
- ThemeTestThemeHooks1
- Hook implementations for theme_test.
Namespace
Drupal\theme_test\HookCode
public function preprocessHtml(&$variables) : void {
$variables['html_attributes']['theme_test_html_attribute'] = 'theme test html attribute value';
$variables['attributes']['theme_test_body_attribute'] = 'theme test body attribute value';
$variables['attributes']['theme_test_page_variable'] = 'Page variable is an array.';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.