Set a custom view for Yii gridview column

We can set a custom php view file to render as view for a column in gridview.

<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'columns' => [
        'id',
        'name',
        [
          'attribute'=>'video',
          'content'=>function($model){
             return $this->render('_video_item',['model'=>$model]);
           }
        ], // here we have set a custom view file for rendering video column
        'created_at:datetime', //this date will be shown as Aug 19, 2020 02:30 PM
        // ...
    ],
]) ?>

Running low on budget? Get the best Shared hosting at an Affordable Rate!