Final Class Yiisoft\Yii\DataView\GridView\Column\Base\DataContext
| Inheritance | Yiisoft\ |
|---|
DataContext provides context information for rendering a data cell in a grid.
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $column | Yiisoft\ |
Yiisoft\ |
|
| $data | array|object | Yiisoft\ |
|
| $index | integer | Yiisoft\ |
|
| $key | int|string | Yiisoft\ |
|
| $preparedDataReader | ?\ |
Yiisoft\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
Property Details
Method Details
| public mixed __construct ( \ | ||
| $preparedDataReader | \ |
The prepared data reader with applied filters, paginating
and sorting. |
| $column | Yiisoft\ |
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,
) {}
User Contributed Notes
Leave a comment
Join the conversation to share a note.