ToolbarOptions
API reference › Yii3 Debug › Middleware › ToolbarOptions
Carries the yii3/debug settings shared by the debugger middlewares, the debugger pages, and the toolbar payload.
One instance built from the application parameters reaches every consumer through the container, so the route prefix and the toolbar presentation cannot drift apart between the services that read them.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$excessiveCallerThreshold readonly constructor | int| | Statements per call site that flag it as excessive, or null to disable the check. Default: null. | ToolbarOptions |
$height readonly constructor | int | Collapsed toolbar height, in pixels. Default: 50. | ToolbarOptions |
$historySize readonly constructor | int | Captures kept before the oldest are rotated out. Default: 50. | ToolbarOptions |
$position readonly constructor | string | Edge the toolbar docks to. Default: 'bottom'. | ToolbarOptions |
$routePrefix readonly | string | Base path the debugger endpoints are served under, without a trailing slash. | ToolbarOptions |
$skipUrls readonly constructor | list<string> | Same-origin URLs excluded from AJAX tracking. Default: []. | ToolbarOptions |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Normalizes the shared route, retention, AJAX, and toolbar presentation settings. | ToolbarOptions |
fromParams() static | Creates the options from the yii3/debug parameter block. | ToolbarOptions |
isDebugPath() | Returns whether a request path targets the debugger itself. | ToolbarOptions |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(string $routePrefix = '/debug', int $historySize = 50, int|null $excessiveCallerThreshold = null, list<string> $skipUrls = [], string $position = 'bottom', int $height = 50)Normalizes the shared route, retention, AJAX, and toolbar presentation settings.
Parameters
| Parameter | Type | Description |
|---|---|---|
$routePrefix | string | Base path the debugger endpoints are served under; a trailing slash is trimmed. |
$historySize | int | Captures kept before the oldest are rotated out. |
$excessiveCallerThreshold | int| | Statements per call site that flag it as excessive, or null to disable the check. |
$skipUrls | list<string> | Same-origin URLs excluded from AJAX tracking. |
$position | string | Edge the toolbar docks to. |
$height | int | Collapsed toolbar height, in pixels. |
fromParams()
Section titled “fromParams() ”public static function fromParams(array<array-key, mixed> $params): selfCreates the options from the yii3/debug parameter block.
A key the block omits keeps its default; a key it declares must hold a value of the expected type, because the parameters are merged from several packages and a wrong type would otherwise surface far from its source.
Parameters
| Parameter | Type | Description |
|---|---|---|
$params | array<array-key, | The yii3/debug parameter block. |
Returns
self: Options carrying the declared values.
Throws
InvalidArgumentException: when a declared key holds a value of the wrong type.
isDebugPath()
Section titled “isDebugPath() ”public function isDebugPath(string $path): boolReturns whether a request path targets the debugger itself.
The prefix must match a whole path segment, so /debugger stays an application path under the /debug prefix.
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | Request path, without the query string. |
Returns
bool: true when the path is the prefix or lies under it; false otherwise.