W3cubDocs

/Drupal 8

public function ControllerResolverInterface::getControllerFromDefinition

public ControllerResolverInterface::getControllerFromDefinition($controller)

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Controller!ControllerResolverInterface.php/function/ControllerResolverInterface::getControllerFromDefinition/8.1.x