HandlerReference
An immutable, framework-agnostic pointer to the code a route runs: a controller class plus the method that handles the request (defaulting to `__invoke` for a single-action handler class). Serializable, so route tables can be compiled and cached; a {@see HandlerResolverInterface} turns it into a live PSR-15 request handler.
HandlerReference::__construct()
public function __construct(string $controller, string $method = '__invoke'):Parameters
| Name | Type | Description |
|---|---|---|
| $controller | class-string | the handler class |
| $method | string | the method that handles the request |
HandlerReference::action()
public static function action(string $controller): selfReference a single-action handler class through its `__invoke` method.
Parameters
| Name | Type | Description |
|---|---|---|
| $controller | class-string |
HandlerReference::method()
public static function method(string $controller, string $method): selfReference a specific method on a controller class.
Parameters
| Name | Type | Description |
|---|---|---|
| $controller | class-string | |
| $method | string |
HandlerReference::__toString()
public function __toString(): stringRender the reference as `Controller::method`.