function ToolbarTestThemeHooks::preprocessMenu
Implements hook_preprocess_HOOK().
Attributes
#[Hook('preprocess_menu')]
File
-
core/
modules/ toolbar/ tests/ modules/ toolbar_test/ src/ Hook/ ToolbarTestThemeHooks.php, line 17
Class
- ToolbarTestThemeHooks
- Hook implementations for toolbar_test.
Namespace
Drupal\toolbar_test\HookCode
public function preprocessMenu(&$variables) : void {
// All the standard hook_theme variables should be populated when the
// Toolbar module is rendering a menu.
foreach ([
'menu_name',
'items',
'attributes',
] as $variable) {
$variables[$variable];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.