You are here

public function HelpController::__construct in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/help/src/Controller/HelpController.php \Drupal\help\Controller\HelpController::__construct()

Creates a new HelpController.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.

\Drupal\help\HelpSectionManager $help_manager: The help section manager.

\Drupal\Core\Extension\ModuleExtensionList|null $module_extension_list: The module extension list. This is left optional for BC reasons, but the optional usage is deprecated and will become required in Drupal 9.0.0.

File

core/modules/help/src/Controller/HelpController.php, line 50

Class

HelpController
Controller routines for help routes.

Namespace

Drupal\help\Controller

Code

public function __construct(RouteMatchInterface $route_match, HelpSectionManager $help_manager, ModuleExtensionList $module_extension_list = NULL) {
  $this->routeMatch = $route_match;
  $this->helpManager = $help_manager;
  if ($module_extension_list === NULL) {
    @trigger_error('Calling HelpController::__construct() with the $module_extension_list argument is supported in drupal:8.8.0 and will be required before drupal:9.0.0. See https://www.drupal.org/node/2709919.', E_USER_DEPRECATED);
    $module_extension_list = \Drupal::service('extension.list.module');
  }
  $this->moduleExtensionList = $module_extension_list;
}