Repository navigation
Internals Router Events RouteEnterEvent
Framework Internals · Subsystem overview · Developer guide
Source: awt_src/classes/router/events/RouteEnterEvent.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\interfaces\IEvent;class RouteEnterEvent implements IEventSource description (behavioral corrections are recorded in Known discrepancies):
Class RouteEnterEvent
Represents an event that is triggered when a route is entered in the router. This event contains information about the route's path, action, and the controller handling the request.
Declarations below preserve visibility, type, default and modifiers exactly. A typed property without an initializer remains uninitialized until its constructor or another method assigns it. Mutable fields belong to this instance unless marked static; readonly fields can be initialized once. Constructor-promoted properties are also listed below.
| Member | Declaration | Purpose or source contract |
|---|---|---|
| $path | public string $path; |
@var string The path of the route that has been entered. |
| $action | public string $action; |
@var string The action associated with the route. |
| $controller | public Controller $controller; |
@var string The name of the controller handling the route. |
| Constructor-promoted | public function __construct(string $path |
Initialized from the constructor argument; default expression is evaluated when the argument is omitted. |
| Method | Signature |
|---|---|
| __construct | public function __construct(string $path, string $action, Controller $controller) |
| getName | public function getName(): string |
| bundle | public function bundle(): array |
public function __construct(string $path, string $action, Controller $controller)| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$path |
string $path |
The path of the route. |
$action |
string $action |
The action associated with the route. |
$controller |
Controller $controller |
Controller that handles the route. |
RouteEnterEvent constructor.
@param string $path The path of the route. @param string $action The action associated with the route. @param string $controller Controller that handles the route.
State writes: $this->path, $this->action, $this->controller.
Implementation, validation guards and interaction order
/**
* RouteEnterEvent constructor.
*
* @param string $path The path of the route.
* @param string $action The action associated with the route.
* @param string $controller Controller that handles the route.
*/
public function __construct(string $path, string $action, Controller $controller)
{
$this->path = $path;
$this->action = $action;
$this->controller = $controller;
}public function getName(): stringReturn expressions (including local callbacks): 'router.enter'.
Implementation, validation guards and interaction order
public function getName(): string
{
return 'router.enter';
}public function bundle(): arrayReturn expressions (including local callbacks): ["path" => $this->path, "action" => $this->action, "controller" => $this->controller].
Implementation, validation guards and interaction order
public function bundle(): array
{
return ["path" => $this->path, "action" => $this->action, "controller" => $this->controller];
}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