Repository navigation
Internals Router Interface IRoute
Framework Internals · Subsystem overview · Developer guide
Source: awt_src/classes/router/interface/IRoute.php · Snapshot 8411f4287706.
Routing separates definition, HTTP request snapshot, matching, method policy, execution and error responses. Collaborators can be replaced through constructor injection.
use controller\Controller;
use event\EventDispatcher;
use middleware\IMiddleware;
use object\ObjectFactory;
use redirect\Redirect;
use response\Response;
use view\View;interface IRouteNo own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.
| Method | Signature |
|---|---|
| getName | public function getName(): ?string |
| setName | public function setName(string $name): self |
| getPath | public function getPath(): string |
| getAction | public function getAction(): string |
| getAlias | public function getAlias(): ?string |
| setAlias | public function setAlias(string $alias): self |
| isService | public function isService(): bool |
| getController | public function getController(): ObjectFactory|Controller |
| setController | public function setController(ObjectFactory|Controller $controller): self |
| getEventDispatcher | public function getEventDispatcher(): EventDispatcher |
| addEventDispatcher | public function addEventDispatcher(EventDispatcher $eventDispatcher): self |
| getMiddleware | public function getMiddleware(): ?IMiddleware |
| addMiddleware | public function addMiddleware(IMiddleware $middleware): self |
| getMethod | public function getMethod(): string |
| setMethod | public function setMethod(string $method): self |
| requiresCsrf | public function requiresCsrf(): bool |
| withoutCsrf | public function withoutCsrf(): self |
| match | public function match(string $requestPath): ?array |
| route | public function route(array $params = [], ?IRequest $request = null): View|Redirect|Response |
public function getName(): ?string;Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function setName(string $name): self;| 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 getPath(): string;Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function getAction(): string;Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function getAlias(): ?string;Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function setAlias(string $alias): self;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$alias |
string $alias |
Resource alias or route metadata alias according to this component. |
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function isService(): bool;Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function getController(): ObjectFactory|Controller;Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function setController(ObjectFactory|Controller $controller): self;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$controller |
ObjectFactory|Controller $controller |
Controller instance or lazy ObjectFactory depending on the union type. |
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function getEventDispatcher(): EventDispatcher;Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
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 getMiddleware(): ?IMiddleware;Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function addMiddleware(IMiddleware $middleware): self;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$middleware |
IMiddleware $middleware |
Middleware object or class name according to the component; route and storage return handling differ. |
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function getMethod(): string;Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function setMethod(string $method): self;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$method |
string $method |
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 requiresCsrf(): bool;Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function withoutCsrf(): self;Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function match(string $requestPath): ?array;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$requestPath |
string $requestPath |
Operation input; the exact use, validation and propagation are shown in 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 route(array $params = [], ?IRequest $request = null): View|Redirect|Response;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$params |
array $params = [] |
Operation input; the exact use, validation and propagation are shown in the implementation trace. |
$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