PHP Class Symfony\Component\HttpKernel\Controller\ControllerResolver

This implementation uses the '_controller' request attribute to determine the controller to execute and uses the request attributes to determine the controller method arguments.
Author: Fabien Potencier ([email protected])
Inheritance: implements Symfony\Component\HttpKernel\Controller\ControllerResolverInterface
Datei anzeigen Open project: symfony/symfony Class Usage Examples

Public Methods

Method Description
__construct ( Psr\Log\LoggerInterface $logger = null ) Constructor.
getArguments ( Request $request, $controller )
getController ( Request $request )

Protected Methods

Method Description
createController ( string $controller ) : callable Returns a callable for the given controller.
doGetArguments ( Request $request, callable $controller, array $parameters ) : array
instantiateController ( string $class ) : object Returns an instantiated controller.

Private Methods

Method Description
getControllerError ( $callable )

Method Details

__construct() public method

Constructor.
public __construct ( Psr\Log\LoggerInterface $logger = null )
$logger Psr\Log\LoggerInterface A LoggerInterface instance

createController() protected method

Returns a callable for the given controller.
protected createController ( string $controller ) : callable
$controller string A Controller string
return callable A PHP callable

doGetArguments() protected method

Deprecation: This method is deprecated as of 3.1 and will be removed in 4.0. Implement the ArgumentResolverInterface and inject it in the HttpKernel instead.
protected doGetArguments ( Request $request, callable $controller, array $parameters ) : array
$request Symfony\Component\HttpFoundation\Request
$controller callable
$parameters array
return array The arguments to use when calling the action

getArguments() public method

Deprecation: This method is deprecated as of 3.1 and will be removed in 4.0. Implement the ArgumentResolverInterface and inject it in the HttpKernel instead.
public getArguments ( Request $request, $controller )
$request Symfony\Component\HttpFoundation\Request

getController() public method

This method looks for a '_controller' request attribute that represents the controller name (a string like ClassName::MethodName).
public getController ( Request $request )
$request Symfony\Component\HttpFoundation\Request

instantiateController() protected method

Returns an instantiated controller.
protected instantiateController ( string $class ) : object
$class string A class name
return object