RouteAction
- Full name:
\Qubus\Routing\Route\RouteAction
Properties
callable
controller
invoker
controllerName
controllerMethod
namespace
Methods
__construct
Constructor
public __construct(mixed $action, ?string $namespace = null, ?\Qubus\Routing\Invoker $invoker = null): mixed
Actions created with a Controller string (e.g. MyController@myMethod
) are lazy loaded and the Controller class will only be instantiated when required.
Parameters:
Parameter | Type | Description |
---|---|---|
$action | mixed | |
$namespace | ?string | |
$invoker | ?\Qubus\Routing\Invoker |
invoke
Invoke the action.
public invoke(\Psr\Http\Message\ServerRequestInterface $request, \Qubus\Routing\Route\RouteParams $params): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$request | \Psr\Http\Message\ServerRequestInterface | |
$params | \Qubus\Routing\Route\RouteParams |
createCallableFromAction
If the action is a Controller string, a factory callable is returned to allow for lazy loading.
Parameters:
Parameter | Type | Description |
---|---|---|
$action | mixed |
isControllerAction
Is this a known Controller based action?
getController
Get the Controller for this action. The Controller will only be created once.
Return Value:
Returns null if this is not a Controller based action.
createControllerFromClassName
Instantiate a Controller object from the provided class name.
Parameters:
Parameter | Type | Description |
---|---|---|
$className | string |
providesMiddleware
Can this action provide Middleware.
getMiddlewares
Get an array of Middleware.
convertClassStringToFactory
Create a factory Closure for the given Controller string.
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | e.g. MyController@myMethod |
Throws:
getActionName
Get the human-readable name of this action.
resolveController
private resolveController(callable|object|string|string[] $controller): callable|object|string|string[]
Parameters:
Parameter | Type | Description |
---|---|---|
$controller | callable|object|string|string[] |
Automatically generated on 2025-10-13