You are here

public function ControllerResolverInterface::getControllerFromDefinition in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Controller/ControllerResolverInterface.php \Drupal\Core\Controller\ControllerResolverInterface::getControllerFromDefinition()
  2. 10 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()

1 method overrides ControllerResolverInterface::getControllerFromDefinition()
ControllerResolver::getControllerFromDefinition in core/lib/Drupal/Core/Controller/ControllerResolver.php
Returns the Controller instance with a given controller route definition.

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