The request lifecycle is the sequence of steps that happen from the moment a user makes an HTTP request until the server sends back a response.
The graph below shows how the request is handled by Dotkernel Light.

The following list describes what each of the steps from the graph does in Dotkernel Light.
Register:
All services are configured and ready to use.
Read all available routes with their allowed request methods and dynamically register them in the application. Routes are managed by FastRoute.
| Item | Value |
|---|---|
| Match | /page/about -> GetPageViewHandler |
| Method | GET |
| Route name | page::about |
Loads the predefined order of middleware. It defines how incoming HTTP requests move through the application and how responses are generated.
FastRoute matches the URL and method against registered routes.
| Item | Value |
|---|---|
| Match | GET /page/about |
| Handler | GetPageViewHandler |
| Route name | page::about |
Extract the matched route name from the request and pass it to the renderer.
$template = $request->getAttribute(RouteResult::class)->getMatchedRouteName();
// $template = 'page::about';
Execute the business logic in the handler. The process can involve services and any custom logic.
Twig loads the template, applies layout, renders blocks and includes partials.
| Item | Value |
|---|---|
| Load | src/Page/templates/page/about.html.twig |
| Extends | @layout/default.html.twig |
| Render blocks | title, content |
| Include partials | alerts.html.twig, etc. |
| Output | Final HTML |
An HtmlResponse is created with status, headers and the rendered HTML body.
| Item | Value |
|---|---|
| Status | 200 OK |
| Content-Type | text/html; charset=utf-8 |
| Body | Rendered HTML |
The response flows back through the middleware stack. Middleware can modify headers, cookies, compress content, etc.
The final response is sent back to the browser. The page is rendered and sent to the user.