function ModuleHandler::load

Same name in other branches
  1. 9 core/lib/Drupal/Core/Extension/ModuleHandler.php \Drupal\Core\Extension\ModuleHandler::load()
  2. 8.9.x core/lib/Drupal/Core/Extension/ModuleHandler.php \Drupal\Core\Extension\ModuleHandler::load()
  3. 10 core/lib/Drupal/Core/Extension/ModuleHandler.php \Drupal\Core\Extension\ModuleHandler::load()

Overrides ModuleHandlerInterface::load

2 calls to ModuleHandler::load()
ModuleHandler::legacyInvoke in core/lib/Drupal/Core/Extension/ModuleHandler.php
Calls a function called $module . '_' . $hook if one exists.
ModuleHandler::loadAll in core/lib/Drupal/Core/Extension/ModuleHandler.php

File

core/lib/Drupal/Core/Extension/ModuleHandler.php, line 98

Class

ModuleHandler
Class that manages modules in a Drupal installation.

Namespace

Drupal\Core\Extension

Code

public function load($name) {
    if (isset($this->loadedFiles[$name])) {
        return TRUE;
    }
    if (isset($this->moduleList[$name])) {
        $this->moduleList[$name]
            ->load();
        $this->loadedFiles[$name] = TRUE;
        return TRUE;
    }
    return FALSE;
}

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