You are here

protected function ControllerBase::moduleHandler in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Controller/ControllerBase.php \Drupal\Core\Controller\ControllerBase::moduleHandler()
  2. 10 core/lib/Drupal/Core/Controller/ControllerBase.php \Drupal\Core\Controller\ControllerBase::moduleHandler()

Returns the module handler.

Return value

\Drupal\Core\Extension\ModuleHandlerInterface

File

core/lib/Drupal/Core/Controller/ControllerBase.php, line 242

Class

ControllerBase
Utility base class for thin controllers.

Namespace

Drupal\Core\Controller

Code

protected function moduleHandler() {
  if (!$this->moduleHandler) {
    $this->moduleHandler = $this
      ->container()
      ->get('module_handler');
  }
  return $this->moduleHandler;
}