You are here

public function ControllerResolver::getController in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Controller/ControllerResolver.php \Drupal\Core\Controller\ControllerResolver::getController()

File

core/lib/Drupal/Core/Controller/ControllerResolver.php, line 81

Class

ControllerResolver
ControllerResolver to enhance controllers beyond Symfony's basic handling.

Namespace

Drupal\Core\Controller

Code

public function getController(Request $request) {
  if (!($controller = $request->attributes
    ->get('_controller'))) {
    return FALSE;
  }
  return $this
    ->getControllerFromDefinition($controller, $request
    ->getPathInfo());
}