class ControllerResolver

Same name in this branch

ControllerResolver to enhance controllers beyond Symfony's basic handling.

It adds two behaviors:

  • When creating a new object-based controller that implements ContainerAwareInterface, inject the container into it. While not always necessary, that allows a controller to vary the services it needs at runtime.
  • By default, a controller name follows the class::method notation. This class adds the possibility to use a service from the container as a controller by using a service:method notation (Symfony uses the same convention).

Hierarchy

Expanded class hierarchy of ControllerResolver

2 files declare their use of ControllerResolver
1 string reference to 'ControllerResolver'
1 service uses ControllerResolver

File

drupal/core/lib/Drupal/Core/Controller/ControllerResolver.php, line 30
Contains \Drupal\Core\Controller\ControllerResolver.

Namespace

Drupal\Core\Controller
View source

Members

Namesort descending Modifiers Type Description Overrides
ControllerResolver::$container protected property The injection container that should be injected into all controllers.
ControllerResolver::$logger private property
ControllerResolver::createController protected function Returns a callable for the given controller. Overrides ControllerResolver::createController
ControllerResolver::doGetArguments protected function
ControllerResolver::getArguments public function Returns the arguments to pass to the controller. Overrides ControllerResolverInterface::getArguments
ControllerResolver::getController public function Returns the Controller instance associated with a Request. Overrides ControllerResolverInterface::getController
ControllerResolver::__construct public function Constructs a new ControllerResolver. Overrides ControllerResolver::__construct