You are here

public function ControllerResolverInterface::getControllerFromDefinition in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Controller/ControllerResolverInterface.php \Drupal\Core\Controller\ControllerResolverInterface::getControllerFromDefinition()
  2. 9 core/lib/Drupal/Core/Controller/ControllerResolverInterface.php \Drupal\Core\Controller\ControllerResolverInterface::getControllerFromDefinition()

Returns the Controller instance with a given controller route definition.

As several resolvers can exist for a single application, a resolver must return false when it is not able to determine the controller.

Parameters

mixed $controller: The controller attribute like in $request->attributes->get('_controller')

Return value

mixed|bool A PHP callable representing the Controller, or false if this resolver is not able to determine the controller

Throws

\InvalidArgumentException|\LogicException Thrown if the controller can't be found.

See also

\Symfony\Component\HttpKernel\Controller\ControllerResolverInterface::getController()

File

core/lib/Drupal/Core/Controller/ControllerResolverInterface.php, line 30

Class

ControllerResolverInterface
Extends the ControllerResolverInterface from symfony.

Namespace

Drupal\Core\Controller

Code

public function getControllerFromDefinition($controller);