ToolbarData
API reference › Debug Core › Toolbar › ToolbarData
Represents the framework-neutral payload loaded by the debug toolbar runtime.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$configUrl readonly constructor | string | Framework configuration URL. | ToolbarData |
$defaultHeight readonly constructor | int | Initial drawer height percentage. Default: 50. | ToolbarData |
$iconBaseUrl readonly constructor | string | Base URL for optional SVG icons. Default: ''. | ToolbarData |
$indexUrl readonly constructor | string | Debug history URL. | ToolbarData |
$items readonly constructor | list<ToolbarPanel> | Toolbar panels. | ToolbarData |
$logo readonly constructor | string| | Primary logo URL or null to use the fallback. Default: null. | ToolbarData |
$logoFallback readonly constructor | string| | Fallback logo URL or null to render the built-in mark. Default: null. | ToolbarData |
$phpInfoUrl readonly constructor | string| | PHP information URL or null when unavailable. Default: null. | ToolbarData |
$phpVersion readonly constructor | string| | PHP version label or null when omitted. Default: null. | ToolbarData |
$position readonly constructor | string | Initial toolbar position. Default: 'bottom'. | ToolbarData |
$tag readonly constructor | string | Captured request tag. | ToolbarData |
$title readonly constructor | string | Toolbar brand title. | ToolbarData |
$yiiVersion readonly constructor | string| | Yii version label or null when omitted. Default: null. | ToolbarData |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
create() static | Creates a minimal toolbar payload ready for immutable enrichment. | ToolbarData |
jsonSerialize() | Returns the complete payload consumed by the toolbar runtime. | ToolbarData |
withBranding() | Returns a copy with brand assets and version labels. | ToolbarData |
withNavigation() | Returns a copy with debugger navigation URLs. | ToolbarData |
withPanels() | Returns a copy with toolbar panels. | ToolbarData |
withPresentation() | Returns a copy with drawer presentation settings. | ToolbarData |
Method details
Section titled “Method details”create()
Section titled “create() ”public static function create(string $tag, string $title): selfCreates a minimal toolbar payload ready for immutable enrichment.
Parameters
| Parameter | Type | Description |
|---|---|---|
$tag | string | |
$title | string |
Returns
self
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array{configUrl: string, defaultHeight: int, iconBaseUrl: string, indexUrl: string, items: list<array{id: string, title: string, items: list<array{value: string, status: string, label?: string, icon?: string, title?: string, url?: string, id?: string}>, url?: string, icon?: string, extension?: true}>, logo: string|null, logoFallback: string|null, phpInfoUrl: string|null, phpVersion: string|null, position: string, tag: string, title: string, yiiVersion: string|null}Returns the complete payload consumed by the toolbar runtime.
Returns
array{configUrl: string, defaultHeight: int, iconBaseUrl: string, indexUrl: string, items: list<array{id: string, title: string, items: list<array{value: string, status: string, label?: string, icon?: string, title?: string, url?: string, id?: string}>, url?: string, icon?: string, extension?: true}>, logo: string|null, logoFallback: string|null, phpInfoUrl: string|null, phpVersion: string|null, position: string, tag: string, title: string, yiiVersion: string|null}: Serialized toolbar payload.
withBranding()
Section titled “withBranding() ”public function withBranding(string|null $logo, string|null $logoFallback, string|null $phpVersion, string|null $yiiVersion): selfReturns a copy with brand assets and version labels.
Parameters
| Parameter | Type | Description |
|---|---|---|
$logo | string| | |
$logoFallback | string| | |
$phpVersion | string| | |
$yiiVersion | string| |
Returns
self
withNavigation()
Section titled “withNavigation() ”public function withNavigation(string $indexUrl, string $configUrl, string|null $phpInfoUrl): selfReturns a copy with debugger navigation URLs.
Parameters
| Parameter | Type | Description |
|---|---|---|
$indexUrl | string | |
$configUrl | string | |
$phpInfoUrl | string| |
Returns
self
withPanels()
Section titled “withPanels() ”public function withPanels(list<PHPForge\Debug\Toolbar\ToolbarPanel> $items): selfReturns a copy with toolbar panels.
withPresentation()
Section titled “withPresentation() ”public function withPresentation(string $position, int $defaultHeight, string $iconBaseUrl = ''): selfReturns a copy with drawer presentation settings.
Parameters
| Parameter | Type | Description |
|---|---|---|
$position | string | |
$defaultHeight | int | |
$iconBaseUrl | string |
Returns
self