Database Queries
$dataProvider,
'id' => 'db-panel-detailed-grid',
'filterModel' => $searchModel,
'filterUrl' => $panel->getUrl(),
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'attribute' => 'duration',
'value' => function ($data) {
return sprintf('%.1f ms',$data['duration']);
},
],
[
'attribute' => 'type',
'value' => function ($data) {
return Html::encode(mb_strtoupper($data['type'],'utf8'));
},
],
[
'attribute' => 'query',
'value' => function ($data) {
$query = Html::encode($data['query']);
if (!empty($data['trace'])) {
$query .= Html::ul($data['trace'], [
'class' => 'trace',
'item' => function ($trace) {
return "{$trace['file']} ({$trace['line']})";
},
]);
}
return $query;
},
'format' => 'html',
'options' => [
'width' => '70%',
],
]
],
]);
?>