ToolbarRenderer
API reference › Yii3 Debug › Web › ToolbarRenderer
Renders shared toolbar views and resolves their assets through Yii3.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a toolbar renderer with Yii3 view and asset services. | ToolbarRenderer |
inject() | Injects toolbar markup immediately before the final closing body tag. | ToolbarRenderer |
render() | Renders the shared toolbar element and the Yii3-published runtime. | ToolbarRenderer |
renderElement() | Renders the framework-neutral toolbar template through the Yii3 view component. | ToolbarRenderer |
scriptTag() | Renders a script tag for the Yii3-published toolbar runtime. | ToolbarRenderer |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(Yiisoft\View\WebView $view, Yiisoft\Assets\AssetManager $assetManager, string $viewPath)Creates a toolbar renderer with Yii3 view and asset services.
Parameters
| Parameter | Type | Description |
|---|---|---|
$view | Yiisoft\ | Yii3 PHP view renderer. |
$assetManager | Yiisoft\ | Yii3 asset publisher. |
$viewPath | string | Resolved path containing the shared debugger templates. |
inject()
Section titled “inject() ”public function inject(string $html, string $toolbar): stringInjects toolbar markup immediately before the final closing body tag.
Parameters
| Parameter | Type | Description |
|---|---|---|
$html | string | Response HTML. |
$toolbar | string | Rendered toolbar markup. |
Returns
string: HTML containing the toolbar, appended when no closing body tag exists.
render()
Section titled “render() ”public function render(string $dataUrl, list<string> $skipUrls = [], string $position = 'bottom', int $height = 50): stringRenders the shared toolbar element and the Yii3-published runtime.
Parameters
| Parameter | Type | Description |
|---|---|---|
$dataUrl | string | Toolbar payload URL. |
$skipUrls | list<string> | Same-origin URLs excluded from AJAX tracking. |
$position | string | Initial toolbar position. |
$height | int | Initial drawer height percentage. |
Returns
string: Toolbar element followed by its published runtime tag.
renderElement()
Section titled “renderElement() ”public function renderElement(string $dataUrl, list<string> $skipUrls = [], string $position = 'bottom', int $height = 50): stringRenders the framework-neutral toolbar template through the Yii3 view component.
Parameters
| Parameter | Type | Description |
|---|---|---|
$dataUrl | string | Toolbar payload URL. |
$skipUrls | list<string> | Same-origin URLs excluded from AJAX tracking. |
$position | string | Initial toolbar position. |
$height | int | Initial drawer height percentage. |
Returns
string: Rendered toolbar custom element.
scriptTag()
Section titled “scriptTag() ”public function scriptTag(): stringRenders a script tag for the Yii3-published toolbar runtime.
Returns
string: Toolbar runtime script tag.