# StandaloneActionResolver

> Merges the standalone actions the debugger exposes and resolves a route against the resulting map.

[API reference](/docs/api/index.md) › [Debug](/docs/extensions/debug/reference/index.md) › [service](/docs/extensions/debug/reference/service/index.md) › StandaloneActionResolver

| class | `yii\debug\service\StandaloneActionResolver` |
| --- | --- |
| Source | [`src/service/StandaloneActionResolver.php`](https://github.com/yii2-extensions/debug/blob/main/src/service/StandaloneActionResolver.php#L16) |

Merges the standalone actions the debugger exposes and resolves a route against the resulting map.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-module"></span>`$module` protected readonly constructor | [`yii\debug\Module`](/docs/extensions/debug/reference/module/index.md) | Debug module read for the action map and the default route at call time. | `StandaloneActionResolver` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Binds standalone action mapping and resolution to the debug module. | `StandaloneActionResolver` |
| [`map()`](#method-map) | Merges the built-in and panel-declared standalone actions with the configured ones. | `StandaloneActionResolver` |
| [`resolve()`](#method-resolve) | Resolves a route against the module action map and binds the action it names. | `StandaloneActionResolver` |

## Method details

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

```php
public function __construct(yii\debug\Module $module)
```

Binds standalone action mapping and resolution to the debug module.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$module` | [`yii\debug\Module`](/docs/extensions/debug/reference/module/index.md) | Debug module read for the action map and the default route at call time. |

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

```php
public function map(array<string, class-string> $core, array<string, yii\debug\Panel> $panels, array<string, array<string, mixed>|class-string> $configured): array<string, array<string, mixed>|class-string>
```

Merges the built-in and panel-declared standalone actions with the configured ones.

Precedence, lowest to highest: the built-in actions, the actions registered panels declare through
[`Panel::$actions`](/docs/extensions/debug/reference/panel/index.md#property-actions), and the entries the application configured directly.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$core` | `array<string, class-string>` | Built-in actions indexed by action ID. |
| `$panels` | `array<string,` [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md)`>` | Registered panels contributing their own actions. |
| `$configured` | `array<string, array<string, mixed>\|class-string>` | Actions configured by the application. |

**Returns**

`array<string, array<string, mixed>|class-string>`: Merged action map indexed by action ID.

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

```php
public function resolve(string $route): yii\base\Action|null
```

Resolves a route against the module action map and binds the action it names.

An empty route falls back to [`Module::$defaultRoute`](/docs/extensions/debug/reference/module/index.md#property-defaultRoute); surrounding slashes are ignored, and a route naming
more than one segment is left to convention-based discovery.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$route` | `string` | Action route relative to the module. |

**Returns**

[`yii\base\Action`](/docs/api/yii/base/action/index.md)`|null`: Action bound to the module, or `null` when the route names no mapped action.

**Throws**

- [`yii\base\InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md): when object creation fails for a resolvable entry.