Loader
Less than 1 minute
Loader
Base contract for router definition loaders.
class LoaderLoader implementations are responsible for preparing route definitions from a specific source (for example files, attributes, or other providers) and may optionally perform request-time matching before the router falls back to in-memory route evaluation.
Lifecycle:
- Constructed by {@see Router} with router configuration.
- {@see self::initialise()} is called during router bootstrap.
- {@see self::evaluateRequest()} may return a pre-resolved route for an incoming request, or
nullto defer to other router matching strategies.
Properties
config
protected array $configrouter
Owning router instance that created this loader.
protected Router $routerMethods
__construct
Loader constructor.
public __construct(Router $router, array $config): voidParameters
| Parameter | Type | Description |
|---|---|---|
$router | Router | |
$config | array |
initialise
Initialises the basic router.
public initialise(): boolevaluateRequest
Evaluates the request and sets the controller, action, and arguments based on the request path.
public evaluateRequest(Request $request): ?RouteParameters
| Parameter | Type | Description |
|---|---|---|
$request | Request | the request object |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:25 +0000