interface 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>

@api

Hierarchy

Expanded class hierarchy of ControllerResolverInterface

All classes that implement ControllerResolverInterface

6 files declare their use of ControllerResolverInterface
ContainerAwareHttpKernel.php in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php
HttpKernel.php in drupal/core/lib/Drupal/Core/HttpKernel.php
Definition of Drupal\Core\HttpKernel.
HttpKernel.php in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php
TestHttpKernel.php in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/TestHttpKernel.php
TestHttpKernel.php in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php

... See full list

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php, line 28

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 mixed|Boolean A PHP callable representing the Controller,
   *                       or false if this resolver is not able to determine the controller
   *
   * @throws \InvalidArgumentException|\LogicException If the controller can't be found
   *
   * @api
   */
  public function getController(Request $request);

  /**
   * Returns the arguments to pass to the controller.
   *
   * @param Request $request    A Request instance
   * @param mixed   $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
   *
   * @api
   */
  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