ModuleHandler::load

public ModuleHandler::load($name)

Includes a module's .module file.

This prevents including a module more than once.

Parameters

string $name: The name of the module to load.

Return value

bool TRUE if the item is loaded or has already been loaded.

Overrides ModuleHandlerInterface::load

File

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

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;
}
doc_Drupal
2016-10-29 09:29:16
Comments
Leave a Comment

Please login to continue.