# RouterPanel

> Presents the routing trace of the request, the configured URL rules, and the discovered action routes.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [Router](/docs/extensions/debug-core/reference/panel/router/index.md) › RouterPanel

| final class | `PHPForge\Debug\Panel\Router\RouterPanel` |
| --- | --- |
| Extends | `PHPForge\Debug\Panel` |
| Source | [`src/Panel/Router/RouterPanel.php`](https://github.com/php-forge/debug-core/blob/main/src/Panel/Router/RouterPanel.php#L19) |

Presents the routing trace of the request, the configured URL rules, and the discovered action routes.

URL rules and action routes are read from live framework services, so the adapter supplies them with
[`RouterPanel::rules()`](/docs/extensions/debug-core/reference/panel/router/routerpanel/index.md#method-rules), [`RouterPanel::actionRoutes()`](/docs/extensions/debug-core/reference/panel/router/routerpanel/index.md#method-actionRoutes), and [`RouterPanel::urlManager()`](/docs/extensions/debug-core/reference/panel/router/routerpanel/index.md#method-urlManager) before presenting.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`actionRoutes()`](#method-actionRoutes) | Returns a new instance with the discovered action routes. | `RouterPanel` |
| [`present()`](#method-present) | Builds the panel view from the decoded routing capture. | `RouterPanel` |
| [`rules()`](#method-rules) | Returns a new instance with the configured URL rules. | `RouterPanel` |
| [`urlManager()`](#method-urlManager) | Returns a new instance with the URL manager configuration. | `RouterPanel` |

## Constants

| Constant | Value | Description | Defined by |
| --- | --- | --- | --- |
| <span id="const-ICON"></span>`ICON` | `\PHPForge\Debug\Panel\Router\RouterMessage::ID->value` |  | `RouterPanel` |
| <span id="const-ID"></span>`ID` | `\PHPForge\Debug\Panel\Router\RouterMessage::ID->value` |  | `RouterPanel` |
| <span id="const-TITLE"></span>`TITLE` | `\PHPForge\Debug\Panel\Router\RouterMessage::TITLE->value` |  | `RouterPanel` |

## Method details

### actionRoutes() <span id="method-actionRoutes"></span>

```php
public function actionRoutes(list<PHPForge\Debug\Panel\Router\ActionRouteRow> $rows): self
```

Returns a new instance with the discovered action routes.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$rows` | `list<`[`ActionRouteRow`](/docs/extensions/debug-core/reference/panel/router/actionrouterow/index.md)`>` | Action routes in display order. |

**Returns**

`self`: New instance carrying the requested action routes.

### present() <span id="method-present"></span>

```php
public function present(array<string, mixed> $data): PHPForge\Debug\PanelView
```

Builds the panel view from the decoded routing capture.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `array<string, mixed>` | Decoded panel payload with `action`, `route`, `message`, and `entries` keys. |

**Returns**

[`PanelView`](https://github.com/php-forge/debug/blob/e4fbb8c3238a4d011ceef5e0094344abd50deaf4/src/PanelView.php): Route overview, rules-tested trace, URL rules, and action routes.

### rules() <span id="method-rules"></span>

```php
public function rules(list<PHPForge\Debug\Panel\Router\RouterRuleRow> $rows): self
```

Returns a new instance with the configured URL rules.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$rows` | `list<`[`RouterRuleRow`](/docs/extensions/debug-core/reference/panel/router/routerrulerow/index.md)`>` | URL rules in display order. |

**Returns**

`self`: New instance carrying the requested URL rules.

### urlManager() <span id="method-urlManager"></span>

```php
public function urlManager(bool $prettyUrl, bool $strictParsing, string $suffix): self
```

Returns a new instance with the URL manager configuration.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$prettyUrl` | `bool` | Whether the URL manager generates and parses pretty URLs. |
| `$strictParsing` | `bool` | Whether the URL manager only accepts requests matching a configured rule. |
| `$suffix` | `string` | Global URL suffix, or `''` when the URL manager declares none. |

**Returns**

`self`: New instance carrying the requested configuration.