Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | |
0.00% |
0 / 12 |
||
anonymous function | |
0.00% |
0 / 1 |
0 | |
0.00% |
0 / 2 |
<?php | |
/* @var $this \humhub\components\View */ | |
/* @var $dataProvider \yii\data\ActiveDataProvider */ | |
use humhub\widgets\GridView; | |
echo GridView::widget([ | |
'dataProvider' => $dataProvider, | |
'columns' => [ | |
['class' => 'yii\grid\SerialColumn'], | |
// Simple columns defined by the data contained in $dataProvider. | |
// Data from the model's column will be used. | |
'id', | |
'username', | |
// More complex one. | |
[ | |
'class' => 'yii\grid\DataColumn', // can be omitted, as it is the default | |
'value' => function ($data) { | |
return $data->name; // $data['name'] for array data, e.g. using SqlDataProvider. | |
}, | |
], | |
], | |
]); |