You are here

public function ControllerResolver::getController in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/http-kernel/Controller/ControllerResolver.php \Symfony\Component\HttpKernel\Controller\ControllerResolver::getController()
  2. 8 core/lib/Drupal/Core/Controller/ControllerResolver.php \Drupal\Core\Controller\ControllerResolver::getController()
Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Controller/ControllerResolver.php \Drupal\Core\Controller\ControllerResolver::getController()

This method looks for a '_controller' request attribute that represents the controller name (a string like ClassName::MethodName).

Overrides ControllerResolver::getController

File

core/lib/Drupal/Core/Controller/ControllerResolver.php, line 93
Contains \Drupal\Core\Controller\ControllerResolver.

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