You are here

interface ControllerResolverInterface in Zircon Profile 8.0

Same name in this branch
  1. 8.0 vendor/symfony/http-kernel/Controller/ControllerResolverInterface.php \Symfony\Component\HttpKernel\Controller\ControllerResolverInterface
  2. 8.0 core/lib/Drupal/Core/Controller/ControllerResolverInterface.php \Drupal\Core\Controller\ControllerResolverInterface
Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/Controller/ControllerResolverInterface.php \Symfony\Component\HttpKernel\Controller\ControllerResolverInterface

A ControllerResolverInterface implementation knows how to determine the controller to execute based on a Request object.

It can also determine the arguments to pass to the Controller.

A Controller can be any valid PHP callable.

@author Fabien Potencier <fabien@symfony.com>

Hierarchy

Expanded class hierarchy of ControllerResolverInterface

All classes that implement ControllerResolverInterface

8 files declare their use of ControllerResolverInterface
ContainerAwareHttpKernel.php in vendor/symfony/http-kernel/DependencyInjection/ContainerAwareHttpKernel.php
ControllerResolverInterface.php in core/lib/Drupal/Core/Controller/ControllerResolverInterface.php
Contains \Drupal\Core\Controller\ControllerResolverInterface.
HttpKernel.php in vendor/symfony/http-kernel/HttpKernel.php
LocalActionManager.php in core/lib/Drupal/Core/Menu/LocalActionManager.php
Contains \Drupal\Core\Menu\LocalActionManager.
LocalActionManagerTest.php in core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php
Contains \Drupal\Tests\Core\Menu\LocalActionManagerTest.

... See full list

File

vendor/symfony/http-kernel/Controller/ControllerResolverInterface.php, line 26

Namespace

Symfony\Component\HttpKernel\Controller
View source
interface ControllerResolverInterface {

  /**
   * Returns the Controller instance associated with a Request.
   *
   * As several resolvers can exist for a single application, a resolver must
   * return false when it is not able to determine the controller.
   *
   * The resolver must only throw an exception when it should be able to load
   * controller but cannot because of some errors made by the developer.
   *
   * @param Request $request A Request instance
   *
   * @return callable|false A PHP callable representing the Controller,
   *                        or false if this resolver is not able to determine the controller
   *
   * @throws \LogicException If the controller can't be found
   */
  public function getController(Request $request);

  /**
   * Returns the arguments to pass to the controller.
   *
   * @param Request  $request    A Request instance
   * @param callable $controller A PHP callable
   *
   * @return array An array of arguments to pass to the controller
   *
   * @throws \RuntimeException When value for argument given is not provided
   */
  public function getArguments(Request $request, $controller);

}

Members

Namesort descending Modifiers Type Description Overrides
ControllerResolverInterface::getArguments public function Returns the arguments to pass to the controller. 5
ControllerResolverInterface::getController public function Returns the Controller instance associated with a Request. 5