简体   繁体   中英

Yii2 GridView multiple rows for one record

I am new in Yii2 framework. I did Gii table, and I wanted to show multiple data related to one ID.

Here is my Grid View:

 <?= GridView::widget([
    'dataProvider' => $dataProvider,

    'columns' => [
        'asosSlave.tovar_nom',


    ],
]); ?>

However, it is only showing one piece of information related to that id:

数据截图

is this mean?

<?= GridView::widget([
    'dataProvider' => $dataProvider,

    'columns' => [
        'asosSlave.tovar_nom',
        ['label'=>'title','value'=>function($model){
             // do you want to do and return 
        )}]
    ],
]); ?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM