# PanelRegistrar

> Instantiates the configured debug panels and resolves the catalog describing their display order.

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

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

Instantiates the configured debug panels and resolves the catalog describing their display order.

Built-in panels are omitted when their optional package is unavailable. Explicit application configuration remains
authoritative and may still register a custom panel under the same ID.

Panels are published on [`Module::$panels`](/docs/extensions/debug/reference/module/index.md#property-panels) as they are built, so a panel reading a sibling while it binds
itself sees every entry registered before it.

## 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 owning the panels and read for configuration at call time. | `PanelRegistrar` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Binds panel registration to the debug module. | `PanelRegistrar` |
| [`register()`](#method-register) | Instantiates every configured panel, binds it to the module, and returns the catalog in display order. | `PanelRegistrar` |

## Method details

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

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

Binds panel registration to the debug module.

**Parameters**

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

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

```php
public function register(array<string, array<string, mixed>|class-string<yii\debug\Panel>|class-string<PHPForge\Debug\Panel>|string> $core, array<array-key, array<string, mixed>|yii\debug\Panel|PHPForge\Debug\Panel|string> $configured): yii\debug\service\PanelCatalog
```

Instantiates every configured panel, binds it to the module, and returns the catalog in display order.

An entry declaring `enabled` as `false` is skipped before its class is resolved and is reported by
[`PanelRegistry::disabled()`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/Registration/PanelRegistry.php#L34); `title` and `icon` overrides apply to portable panels only, because a Yii
panel renders the metadata it declares itself. A panel whose [`Panel::isEnabled()`](/docs/extensions/debug/reference/panel/index.md#method-isEnabled) returns `false` is
dropped after construction.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$core` | `array<string, array<string, mixed>\|class-string<`[`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md)`>\|class-string<PHPForge\Debug\Panel>\|string>` | Built-in panel definitions indexed by panel ID. |
| `$configured` | `array<array-key, array<string, mixed>\|`[`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md)`\|PHPForge\Debug\Panel\|string>` | Panel definitions declared by the application. |

**Returns**

[`PanelCatalog`](/docs/extensions/debug/reference/service/panelcatalog/index.md): Registered panels in display order and the catalog describing them.

**Throws**

- [`yii\base\InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md): when a definition, a registration option, or the resolved catalog is invalid.