You are here

public function ModuleHandler::load in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Extension/ModuleHandler.php \Drupal\Core\Extension\ModuleHandler::load()

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

1 call to ModuleHandler::load()
ModuleHandler::loadAll in core/lib/Drupal/Core/Extension/ModuleHandler.php
Loads all enabled modules.

File

core/lib/Drupal/Core/Extension/ModuleHandler.php, line 119
Contains \Drupal\Core\Extension\ModuleHandler.

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;
}