class NavigationRequirements

Requirements for the navigation module.

Hierarchy

  • class \Drupal\navigation\Hook\NavigationRequirements uses \Drupal\Core\StringTranslation\StringTranslationTrait

Expanded class hierarchy of NavigationRequirements

File

core/modules/navigation/src/Hook/NavigationRequirements.php, line 15

Namespace

Drupal\navigation\Hook
View source
class NavigationRequirements {
    use StringTranslationTrait;
    public function __construct(ModuleHandlerInterface $moduleHandler) {
    }
    
    /**
     * Implements hook_runtime_requirements().
     */
    public function runtime() : array {
        $requirements = [];
        if ($this->moduleHandler
            ->moduleExists('toolbar')) {
            $requirements['toolbar'] = [
                'title' => $this->t('Toolbar and Navigation modules are both installed'),
                'value' => $this->t('The Navigation module is a complete replacement for the Toolbar module and disables its functionality when both modules are installed. If you are planning to continue using Navigation module, you can uninstall the Toolbar module now.'),
                'severity' => RequirementSeverity::Warning,
            ];
        }
        return $requirements;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overrides
NavigationRequirements::runtime public function Implements hook_runtime_requirements().
NavigationRequirements::__construct public function
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

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