Repository navigation
Internals 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.
use event\EventDispatcher;
use redirect\Redirect;
use response\Response;
use view\View;interface IRouterManager extends IRouterNo own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.
| 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 |
public function addEventDispatcher(EventDispatcher $eventDispatcher): self;| 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.
public function loadRouters(array $routers): void;| 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.
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.
public function getRouteByName(string $name): ?IRoute;| 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.
public function getRouteByPath(string $path, string $method = 'GET'): ?IRoute;| 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.
public function startRouter(?IRequest $request = null): View|Redirect|Response;| 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.
AWT Framework Wiki · Home · Installation Guide · Developer Guide · Framework Internals
Philosophy · Architecture · Known discrepancies · Verification
Installation Guide
Developer Guide
- Learning sequence
- First package
- Package structure
- Lifecycle
- Runtimes
- Events and objects
- Routing and controllers
- Views and resources
- Database and models
- Storage and caching
- Configuration and CLI
- Responses and errors
- Extension points
Framework Internals
- Architecture
- Bootstrap
- Packages
- Runtime
- Events and context
- Objects
- HTTP routing and controllers
- Rendering
- Blade integration
- Database
- Models
- Storage and caching
- Settings
- CLI
- Identity and sessions
- Responses
- Errors
- Complete source inventory
Documentation notes