FilterRemoval
API reference › Yii3 Debug › Web › FilterRemoval
Rewrites a panel filter group in the query parameters and renders the banner dropping single filters: replaces the group with the active filters or removes selected attributes while resetting pagination, without changing unrelated navigation parameters.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
banner() static | Renders the active-filter banner whose links remove single filters from the panel query. | FilterRemoval |
queryParams() static | Returns the query parameters with the named filter removed. | FilterRemoval |
withGroup() static | Replaces the filter group with the active filters, or removes it when no filter is active. | FilterRemoval |
Method details
Section titled “Method details”banner()
Section titled “banner() ”public static function banner(array<string, string> $activeFilters, PHPForge\Debug\Panel\PanelRenderContext $context, array<array-key, mixed> $queryParams, string $prefix): stringRenders the active-filter banner whose links remove single filters from the panel query.
The clear-all link drops the union of the submitted group keys and the active ones, so values the panel search rejected are cleared together with the filters they left out.
Parameters
| Parameter | Type | Description |
|---|---|---|
$activeFilters | array<string, | Attribute-to-value map of the currently applied filters. |
$context | PHPForge\ | Context resolving the panel URL and exposing the submitted query. |
$queryParams | array<array-key, | Query parameters already normalized by the panel. |
$prefix | string | Filter group the removed attributes belong to. |
Returns
string: Rendered banner, or '' when no filter is active.
queryParams()
Section titled “queryParams() ”public static function queryParams(array<array-key, mixed> $queryParams, string $prefix, list<string> $without): array<array-key, mixed>Returns the query parameters with the named filter removed.
Parameters
| Parameter | Type | Description |
|---|---|---|
$queryParams | array<array-key, | Query parameters already normalized by the panel. |
$prefix | string | Filter group to update. |
$without | list<string> | Attributes to remove from that group. |
Returns
array<array-key, mixed>: Query parameters without those attributes.
withGroup()
Section titled “withGroup() ”public static function withGroup(array<array-key, mixed> $queryParams, string $prefix, array<string, string> $filters, list<string> $drop = []): array<array-key, mixed>Replaces the filter group with the active filters, or removes it when no filter is active.
The group keeps its current position in the query, so link query strings preserve their parameter order.
Parameters
| Parameter | Type | Description |
|---|---|---|
$queryParams | array<array-key, | Query parameters already normalized by the panel. |
$prefix | string | Filter group to replace. |
$filters | array<string, | Active filters; an empty set removes the group. |
$drop | list<string> | Unrelated parameters to remove, such as view. |
Returns
array<array-key, mixed>: Query parameters carrying the replaced group.