It provides features like sorting, paging and also filtering the data.
$dataProvider, 'columns' => [ 'name', 'price', 'category', ], ]) ?>
$dataProvider, 'columns' => [ 'id', 'name', 'email', [ 'attribute' => 'status', 'value' => function ($model) { return ($model->status === 1) ? 'Active' : 'Inactive'; }, ], ], ]) ?>In this example, we are passing a dataProvider object which contains the data to be displayed in the GridView. We are defining the columns to be displayed using an array of column names, but for the status column, we are using a closure to generate a custom value based on the status column value. The Yii GridView widget is part of the Yii Framework core package.