Put grid view next to detail view in a view file

I want to use my grid view in right hand side of my article (A view) How can i achive this?

  1. In controller action, add code to create data provider for GridView
    https://www.yiiframework.com/doc/guide/2.0/en/output-data-providers

  2. In view file, you can use bootstrap columns to display article and gridview next to it. So something like this:

<div class="row">
    <div class="col-md-6">
    ....your code to display the article....
    </div>
    <div class="col-md-6">
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
    ]); ?> 
    </div>
</div>
2 Likes

@jaimez Yeah it has solved my issue