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