# RequestRoutingViewFactory

> Adapts captured Yii routing state and the live route collection to the framework-neutral Request view.

[API reference](/docs/api/index.md) › [Yii3 Debug](/docs/extensions/yii3-debug/reference/index.md) › [Routing](/docs/extensions/yii3-debug/reference/routing/index.md) › RequestRoutingViewFactory

| final class | `Yii3\Debug\Routing\RequestRoutingViewFactory` |
| --- | --- |
| Source | [`src/Routing/RequestRoutingViewFactory.php`](https://github.com/yii3/debug/blob/main/src/Routing/RequestRoutingViewFactory.php#L22) |

Adapts captured Yii routing state and the live route collection to the framework-neutral Request view.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`fromRequestData()`](#method-fromRequestData) static | Composes the Request routing view from the captured payload and the live route collection. | `RequestRoutingViewFactory` |

## Method details

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

```php
public static function fromRequestData(array<array-key, mixed> $data, Yiisoft\Router\RouteCollectionInterface|null $routes): PHPForge\Debug\Panel\Request\Routing\RequestRoutingView
```

Composes the Request routing view from the captured payload and the live route collection.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `array<array-key, mixed>` | Captured Request panel data. |
| `$routes` | `Yiisoft\Router\RouteCollectionInterface\|null` | Live route collection, or `null` when it cannot be resolved. |

**Returns**

`PHPForge\Debug\Panel\Request\Routing\RequestRoutingView`: Composed view of the current route and the application route inventory.