function NavigationTestHooks::navigationContentTopAlter

Same name and namespace in other branches
  1. 11.x core/modules/navigation/tests/navigation_test/src/Hook/NavigationTestHooks.php \Drupal\navigation_test\Hook\NavigationTestHooks::navigationContentTopAlter()

Implements hook_navigation_content_top_alter().

Attributes

#[Hook('navigation_content_top_alter')]

File

core/modules/navigation/tests/navigation_test/src/Hook/NavigationTestHooks.php, line 78

Class

NavigationTestHooks
Hooks implementations for navigation_test module.

Namespace

Drupal\navigation_test\Hook

Code

public function navigationContentTopAlter(&$content_top) : void {
  if (\Drupal::keyValue('navigation_test')->get('content_top_alter')) {
    unset($content_top['navigation_foo']);
    $content_top['navigation_bar']['#markup'] = 'new bar';
    $content_top['navigation_baz']['#weight'] = '-100';
  }
}

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