class NavigationTestHooks
Hooks implementations for navigation_test module.
Hierarchy
- class \Drupal\navigation_test\Hook\NavigationTestHooks
Expanded class hierarchy of NavigationTestHooks
File
-
core/
modules/ navigation/ tests/ navigation_test/ src/ Hook/ NavigationTestHooks.php, line 13
Namespace
Drupal\navigation_test\HookView source
class NavigationTestHooks {
/**
* NavigationTestHooks constructor.
*
* @param \Drupal\Core\State\StateInterface $state
* The state service.
*/
public function __construct(StateInterface $state) {
}
/**
* Implements hook_block_alter().
*/
public function blockAlter(&$definitions) : void {
if ($this->state
->get('navigation_safe_alter')) {
$definitions['navigation_link']['allow_in_navigation'] = TRUE;
$definitions['navigation_shortcuts']['allow_in_navigation'] = FALSE;
}
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
NavigationTestHooks::blockAlter | public | function | Implements hook_block_alter(). |
NavigationTestHooks::__construct | public | function | NavigationTestHooks constructor. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.