Skip to content
PHP Ecosystem
Explore

PanelRenderContext

API reference › Debug Core › Panel › PanelRenderContext

final readonly classPHPForge\Debug\Panel\PanelRenderContext
Sourcesrc/Panel/PanelRenderContext.php

Supplies request, theme, and adapter-owned URL state to a framework-neutral panel renderer.

PropertyTypeDescriptionDefined by
$panel readonly constructorstringStable identifier of the panel being rendered.PanelRenderContext
$queryParams readonly constructorarray<array-key, mixed>Parsed query parameters of the current debugger request.PanelRenderContext
$tag readonly constructorstringCaptured request tag.PanelRenderContext
$theme readonly constructorstringResolved debugger theme.PanelRenderContext
MethodDescriptionDefined by
__construct()Creates the request, theme, and URL context for a panel renderer.PanelRenderContext
panelPayload()Returns another panel payload from the current snapshot when cross-panel composition is required.PanelRenderContext
panelUrl()Builds a panel URL for this captured request.PanelRenderContext
public function __construct(string $tag, string $panel, array<array-key, mixed> $queryParams, string $theme, PHPForge\Debug\Routing\DebugUrlGeneratorInterface $urls, array<string, array<string, mixed>> $panels = [])

Creates the request, theme, and URL context for a panel renderer.

Parameters

ParameterTypeDescription
$tagstringCaptured request tag.
$panelstringStable identifier of the panel being rendered.
$queryParamsarray<array-key, mixed>Parsed query parameters of the current debugger request.
$themestringResolved debugger theme.
$urlsPHPForge\Debug\Routing\DebugUrlGeneratorInterfaceAdapter-owned URL generator.
$panelsarray<string, array<string, mixed>>Serialized panel payloads from the current snapshot.
public function panelPayload(string $panel): array<string, mixed>|null

Returns another panel payload from the current snapshot when cross-panel composition is required.

Parameters

ParameterTypeDescription
$panelstring

Returns

array<string, mixed>|null: Serialized panel payload, or null when it was not captured.

public function panelUrl(string|null $panel = null, array<array-key, mixed>|null $queryParams = null): string

Builds a panel URL for this captured request.

Parameters

ParameterTypeDescription
$panelstring|nullTarget panel, or null to keep the current panel.
$queryParamsarray<array-key, mixed>|nullPanel parameters, or null to reuse the current query.

Returns

string