Yii2 Bootstrap 3
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1006 B

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