Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ControllerResolver.php

function ControllerResolver::getControllerFromDefinition

Overrides ControllerResolverInterface::getControllerFromDefinition

1 call to ControllerResolver::getControllerFromDefinition()
ControllerResolver::getController in core/lib/Drupal/Core/Controller/ControllerResolver.php
Returns the Controller instance associated with a Request.

File

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

Class

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

Namespace

Drupal\Core\Controller

Code

public function getControllerFromDefinition($controller, $path = '') {
    try {
        $callable = $this->callableResolver
            ->getCallableFromDefinition($controller);
    } catch (\InvalidArgumentException $e) {
        throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable.', $path), 0, $e);
    }
    return $callable;
}
RSS feed
Powered by Drupal