function ControllerResolver::getController

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Controller/ControllerResolver.php \Drupal\Core\Controller\ControllerResolver::getController()
  2. 10 core/lib/Drupal/Core/Controller/ControllerResolver.php \Drupal\Core\Controller\ControllerResolver::getController()
  3. 11.x 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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.