Skip to content
PHP Ecosystem
Explore

DebugPageRenderer

API reference › Yii3 Debug › Web › DebugPageRenderer

final classYii3\Debug\Web\DebugPageRenderer
Sourcesrc/Web/DebugPageRenderer.php

Renders debugger pages and optional extension panels with the shared Debug Core shell.

MethodDescriptionDefined by
__construct()Creates the page renderer with its view, assets, configuration, templates, and debugger routes.DebugPageRenderer
compare()Renders the comparison page for two captures.DebugPageRenderer
config()Renders the live configuration page.DebugPageRenderer
extension()Renders one captured extension panel.DebugPageRenderer
hasExtensionPanel()Returns whether a panel is registered under the given ID.DebugPageRenderer
history()Renders the captured request history.DebugPageRenderer
phpInfo()Renders the phpinfo() page inside the debugger shell.DebugPageRenderer
withExtensionPanels()Returns a copy carrying the extension panels shown in the sidebar.DebugPageRenderer
public function __construct(Yiisoft\View\WebView $view, Yiisoft\Assets\AssetManager $assetManager, Yii3\Debug\ConfigDataFactory $configDataFactory, string $viewPath, Yii3\Debug\Middleware\ToolbarOptions $options = new \Yii3\Debug\Middleware\ToolbarOptions())

Creates the page renderer with its view, assets, configuration, templates, and debugger routes.

Parameters

ParameterTypeDescription
$viewYiisoft\View\WebViewView rendering the debugger templates.
$assetManagerYiisoft\Assets\AssetManagerManager resolving the published URLs of the debugger assets.
$configDataFactoryYii3\Debug\ConfigDataFactoryFactory building the live configuration payload.
$viewPathstringDirectory the debugger templates are read from.
$optionsYii3\Debug\Middleware\ToolbarOptionsSettings carrying the route prefix every debugger URL is built on.
public function compare(Yii3\Debug\Comparison\HistoryComparison $comparison, array<string, PHPForge\Debug\Storage\RequestSummary> $manifest, string $theme): string

Renders the comparison page for two captures.

Parameters

ParameterTypeDescription
$comparisonYii3\Debug\Comparison\HistoryComparisonDifferences between the two captures.
$manifestarray<string, PHPForge\Debug\Storage\RequestSummary>Captured request summaries keyed by tag.
$themestringResolved theme: 'light' or 'dark'.

Returns

string: Rendered debugger page.

public function config(string $tag, string $theme, array<string, PHPForge\Debug\Storage\RequestSummary> $manifest = [], PHPForge\Debug\Storage\DebugSnapshot|null $snapshot = null): string

Renders the live configuration page.

Parameters

ParameterTypeDescription
$tagstringCapture in context, used by the sidebar links.
$themestringResolved theme: 'light' or 'dark'.
$manifestarray<string, PHPForge\Debug\Storage\RequestSummary>Captured request summaries keyed by tag.
$snapshotPHPForge\Debug\Storage\DebugSnapshot|nullCapture backing the sidebar, or null when none is selected.

Returns

string: Rendered debugger page.

public function extension(PHPForge\Debug\Storage\DebugSnapshot $snapshot, string $panelId, string $theme, array<string, PHPForge\Debug\Storage\RequestSummary> $manifest = [], array<array-key, mixed> $queryParams = []): string

Renders one captured extension panel.

Parameters

ParameterTypeDescription
$snapshotPHPForge\Debug\Storage\DebugSnapshotCapture the panel renders.
$panelIdstringPanel to render.
$themestringResolved theme: 'light' or 'dark'.
$manifestarray<string, PHPForge\Debug\Storage\RequestSummary>Captured request summaries keyed by tag.
$queryParamsarray<array-key, mixed>Raw query parameters of the debugger request.

Returns

string: Rendered debugger page.

public function hasExtensionPanel(string $panelId): bool

Returns whether a panel is registered under the given ID.

Parameters

ParameterTypeDescription
$panelIdstringPanel to look up.

Returns

bool: true when the panel is registered; false otherwise.

public function history(array<string, PHPForge\Debug\Storage\RequestSummary> $manifest, array<array-key, mixed> $queryParams, string $theme, PHPForge\Debug\Storage\DebugSnapshot|null $snapshot = null): string

Renders the captured request history.

Parameters

ParameterTypeDescription
$manifestarray<string, PHPForge\Debug\Storage\RequestSummary>Captured request summaries keyed by tag.
$queryParamsarray<array-key, mixed>Raw query parameters of the debugger request.
$themestringResolved theme: 'light' or 'dark'.
$snapshotPHPForge\Debug\Storage\DebugSnapshot|nullCapture backing the sidebar, or null when none is selected.

Returns

string: Rendered debugger page.

public function phpInfo(string $theme, array<string, PHPForge\Debug\Storage\RequestSummary> $manifest = [], PHPForge\Debug\Storage\DebugSnapshot|null $snapshot = null): string

Renders the phpinfo() page inside the debugger shell.

Parameters

ParameterTypeDescription
$themestringResolved theme: 'light' or 'dark'.
$manifestarray<string, PHPForge\Debug\Storage\RequestSummary>Captured request summaries keyed by tag.
$snapshotPHPForge\Debug\Storage\DebugSnapshot|nullCapture backing the sidebar, or null when none is selected.

Returns

string: Rendered debugger page.

public function withExtensionPanels(iterable<Yii3\Debug\Panel\ExtensionPanelInterface> $extensionPanels): self

Returns a copy carrying the extension panels shown in the sidebar.

Parameters

ParameterTypeDescription
$extensionPanelsiterable<Yii3\Debug\Panel\ExtensionPanelInterface>Optional panel presenters in sidebar order.

Returns

self: Renderer with the panels applied.