Repository navigation
Internals Router Response RouteResponseFactory
Framework Internals · Subsystem overview · Developer guide
Source: awt_src/classes/router/response/RouteResponseFactory.php · Snapshot 8411f4287706.
Routing separates definition, HTTP request snapshot, matching, method policy, execution and error responses. Collaborators can be replaced through constructor injection.
use response\Response;
use router\interface\IRouteResponseFactory;final class RouteResponseFactory implements IRouteResponseFactoryNo own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.
| Method | Signature |
|---|---|
| notFound | public function notFound(): Response |
| methodNotAllowed | public function methodNotAllowed(array $allowed): Response |
| csrfRejected | public function csrfRejected(): Response |
public function notFound(): ResponseReturn expressions (including local callbacks): Response::make(404, 'Not Found')->asHtml().
Implementation, validation guards and interaction order
public function notFound(): Response
{
return Response::make(404, 'Not Found')->asHtml();
}public function methodNotAllowed(array $allowed): Response| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$allowed |
array $allowed |
Operation input; the exact use, validation and propagation are shown in the implementation trace. |
Return expressions (including local callbacks): Response::make(405, 'Method Not Allowed') ->header('Allow', implode(', ', $allowed))->asJson().
External effects include header.
Implementation, validation guards and interaction order
public function methodNotAllowed(array $allowed): Response
{
return Response::make(405, 'Method Not Allowed')
->header('Allow', implode(', ', $allowed))->asJson();
}public function csrfRejected(): ResponseReturn expressions (including local callbacks): Response::make(403, 'Invalid CSRF token')->asJson().
Implementation, validation guards and interaction order
public function csrfRejected(): Response
{
return Response::make(403, 'Invalid CSRF token')->asJson();
}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