class ToolbarRequirements
Requirements for the navigation module.
Hierarchy
- class \Drupal\toolbar\Hook\ToolbarRequirements uses \Drupal\Core\StringTranslation\StringTranslationTrait
Expanded class hierarchy of ToolbarRequirements
File
-
core/
modules/ toolbar/ src/ Hook/ ToolbarRequirements.php, line 15
Namespace
Drupal\toolbar\HookView source
class ToolbarRequirements {
use StringTranslationTrait;
public function __construct(protected readonly ModuleHandlerInterface $moduleHandler) {
}
/**
* Implements hook_runtime_requirements().
*/
public function runtime() : array {
$requirements = [];
if ($this->moduleHandler
->moduleExists('navigation')) {
$requirements['navigation'] = [
'title' => $this->t('Toolbar and Navigation modules are both installed'),
'value' => $this->t('Toolbar is disabled when the Navigation replacement module is available to the current user. It is recommended to uninstall Toolbar.'),
'severity' => RequirementSeverity::Warning,
];
}
return $requirements;
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary | Overrides |
|---|---|---|---|---|
| StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | 3 |
| StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | |
| StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | |
| StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | |
| StringTranslationTrait::setStringTranslation | public | function | Sets the string translation service to use. | 2 |
| StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. | 1 |
| ToolbarRequirements::runtime | public | function | Implements hook_runtime_requirements(). | |
| ToolbarRequirements::__construct | public | function |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.