Final Class Yiisoft\Yii\DataView\GridView\Column\Base\FilterContext
| Inheritance | Yiisoft\Yii\DataView\GridView\Column\Base\FilterContext |
|---|
FilterContext provides context information for rendering and handling grid column filters.
Public Properties
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Creates a new filter context instance. | Yiisoft\Yii\DataView\GridView\Column\Base\FilterContext |
| getQueryValue() | Get the value of a query parameter from the URL. | Yiisoft\Yii\DataView\GridView\Column\Base\FilterContext |
Property Details
Method Details
Creates a new filter context instance.
| public mixed __construct ( string $formId, \Yiisoft\Validator\Result $validationResult, string|null $cellInvalidClass, array $errorsContainerAttributes, Yiisoft\Yii\DataView\Url\UrlParameterProviderInterface $urlParameterProvider ) | ||
| $formId | string |
The unique identifier of the filter form. This ID is used to associate filter inputs with their form using the HTML form attribute. |
| $validationResult | \Yiisoft\Validator\Result |
The validation result containing any validation errors. Use this to check for errors and display appropriate messages. |
| $cellInvalidClass | string|null |
CSS class to be applied to cells with invalid filter values. Set to null to disable invalid state styling. |
| $errorsContainerAttributes | array |
HTML attributes for the container that displays validation errors. Use these to style and position error messages. |
| $urlParameterProvider | Yiisoft\Yii\DataView\Url\UrlParameterProviderInterface |
Provider for accessing URL parameters. Used to retrieve filter values from the current request. |
public function __construct(
public readonly string $formId,
public readonly Result $validationResult,
public readonly ?string $cellInvalidClass,
public readonly array $errorsContainerAttributes,
private readonly UrlParameterProviderInterface $urlParameterProvider,
) {}
Get the value of a query parameter from the URL.
| public string|null getQueryValue ( string $name ) | ||
| $name | string |
The name of the query parameter to retrieve. |
| return | string|null |
The value of the query parameter or |
|---|---|---|
public function getQueryValue(string $name): ?string
{
return $this->urlParameterProvider->get($name, UrlParameterType::Query);
}
Signup or Login in order to comment.