0 follower

Final Class Yiisoft\Yii\DataView\GridView\Column\Base\DataContext

InheritanceYiisoft\Yii\DataView\GridView\Column\Base\DataContext

DataContext provides context information for rendering a data cell in a grid.

Property Details

Hide inherited properties

$column public property
$data public property
public array|object $data null
$index public property
public integer $index null
$key public property
public integer|string $key null
$preparedDataReader public property
public \Yiisoft\Data\Reader\ReadableDataInterface|null $preparedDataReader null

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( \Yiisoft\Data\Reader\ReadableDataInterface|null $preparedDataReader, Yiisoft\Yii\DataView\GridView\Column\ColumnInterface $column, array|object $data, integer|string $key, integer $index )
$preparedDataReader \Yiisoft\Data\Reader\ReadableDataInterface|null

The prepared data reader with applied filters, paginating and sorting. null means that there is no data.

$column Yiisoft\Yii\DataView\GridView\Column\ColumnInterface

The column being rendered. This provides access to the column configuration and behavior definitions.

$data array|object

The data item being displayed. This can be either an array or an object containing the row's data.

$key integer|string

The key associated with the data item. This uniquely identifies the row in the dataset and can be used for generating URLs or implementing row operations.

$index integer

The zero-based index of the row in the data provider. This can be used for implementing alternate row styling or position-based logic.

                public function __construct(
    public readonly ?ReadableDataInterface $preparedDataReader,
    public readonly ColumnInterface $column,
    public readonly array|object $data,
    public readonly int|string $key,
    public readonly int $index,
) {}