RouterCollector
API reference › Debug › collectors › RouterCollector
Captures the routing trace of the request for the Router panel.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$module | yii\| | Debug module supplying the log target and sibling collectors, assigned by the module on registration. Default: null. | Collector |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
capture() final | Encodes the typed snapshot built by the subclass into the payload persisted for the panel. | Collector |
getCategories() | Returns the log categories scanned for routing trace messages. | RouterCollector |
id() | Returns the stable ID pairing this collector with the Router panel. | RouterCollector |
instrument() | Installs low-level instrumentation as soon as the module registers the collector, before the panels are built. | Collector |
setCategories() | Appends one or more log categories to $categories. | RouterCollector |
shutdown() final | Deactivates the collector once, releasing any subscription created by start(). | Collector |
startup() final | Activates the collector once at the start of the request lifecycle. | Collector |
getLogMessages() protected | Returns the accumulated log messages, optionally filtered by level, category, and exclusion lists. | Collector |
getLogTarget() protected | Returns the initialized log target of the owning debug module. | Collector |
isStarted() protected | Returns whether the collector is active for the current request. | Collector |
snapshot() protected | Snapshots the routing trace, the resolved route, and the dispatched action. | RouterCollector |
start() protected | Hook invoked once when the collector activates; subclasses subscribe to framework events here. | Collector |
stop() protected | Hook invoked once when the collector deactivates; subclasses detach subscriptions and clear state here. | Collector |
Method details
Section titled “Method details”getCategories()
Section titled “getCategories() ”public function getCategories(): list<string>Returns the log categories scanned for routing trace messages.
Returns
list<string>: Category names in declaration order.
public function id(): stringReturns the stable ID pairing this collector with the Router panel.
Returns
string: Stable collector ID.
setCategories()
Section titled “setCategories() ”public function setCategories(list<string>|string $values): voidAppends one or more log categories to $categories.
Parameters
| Parameter | Type | Description |
|---|---|---|
$values | list<string>| | Single category, or list of categories. |
snapshot()
Section titled “snapshot() ”protected function snapshot(): PHPForge\Debug\Panel\Router\RouterSnapshot|nullSnapshots the routing trace, the resolved route, and the dispatched action.
Returns
PHPForge\Debug\Panel\Router\RouterSnapshot|null: Captured routing payload; null when the collector never started.