Skip to content

Internals Router Interface IRouterManager

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

router\interface\IRouterManager

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/router/interface/IRouterManager.php · Snapshot 8411f4287706.

Routing separates definition, HTTP request snapshot, matching, method policy, execution and error responses. Collaborators can be replaced through constructor injection.

Imports and dependencies

use event\EventDispatcher;
use redirect\Redirect;
use response\Response;
use view\View;

IRouterManager

Declaration and architectural role

interface IRouterManager extends IRouter

Constants, enum cases, traits and properties

No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.

Method index

Method Signature
addEventDispatcher public function addEventDispatcher(EventDispatcher $eventDispatcher): self
loadRouters public function loadRouters(array $routers): void
getRoutes public function getRoutes(): array
getRouteByName public function getRouteByName(string $name): ?IRoute
getRouteByPath public function getRouteByPath(string $path, string $method = 'GET'): ?IRoute
startRouter public function startRouter(?IRequest $request = null): View|Redirect|Response

addEventDispatcher

Source line 12

public function addEventDispatcher(EventDispatcher $eventDispatcher): self;

Parameters

Parameter Type, modifiers and default Purpose
$eventDispatcher EventDispatcher $eventDispatcher Dispatcher used for synchronous listener registration/dispatch and context propagation.

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

loadRouters

Source line 14

public function loadRouters(array $routers): void;

Parameters

Parameter Type, modifiers and default Purpose
$routers array $routers */

@param IRoute[] $routers

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

getRoutes

Source line 16

public function getRoutes(): array;

@return array<string, IRoute>

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

getRouteByName

Source line 17

public function getRouteByName(string $name): ?IRoute;

Parameters

Parameter Type, modifiers and default Purpose
$name string $name Named key/label selected by this API; its exact scope is shown by the implementation trace.

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

getRouteByPath

Source line 18

public function getRouteByPath(string $path, string $method = 'GET'): ?IRoute;

Parameters

Parameter Type, modifiers and default Purpose
$path string $path Filesystem or route path as defined by the owning component; no universal path normalization is implied.
$method string $method = 'GET' HTTP method token; validation/normalization follows the method policy.

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

startRouter

Source line 19

public function startRouter(?IRequest $request = null): View|Redirect|Response;

Parameters

Parameter Type, modifiers and default Purpose
$request ?IRequest $request = null Request snapshot consumed by matching, method and security checks.

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

Related types

Clone this wiki locally