1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
use yii\helpers\Html; |
4
|
|
|
use yii\grid\GridView; |
5
|
|
|
use monsterhunter\yii2\log\Module; |
6
|
|
|
|
7
|
|
|
/* @var $this yii\web\View */ |
8
|
|
|
/* @var $searchModel monsterhunter\yii2\log\models\search\SystemLogSearch */ |
9
|
|
|
/* @var $dataProvider yii\data\ActiveDataProvider */ |
10
|
|
|
|
11
|
|
|
$this->title = Module::t('log', 'System Logs'); |
12
|
|
|
$this->params['breadcrumbs'][] = $this->title; |
13
|
|
|
?> |
14
|
|
|
<div class="system-log-index"> |
15
|
|
|
|
16
|
|
|
<p> |
17
|
|
|
<?php echo Html::a(Module::t('log', 'Clear'), false, ['class' => 'btn btn-danger', 'data-method' => 'delete']) ?> |
|
|
|
|
18
|
|
|
</p> |
19
|
|
|
|
20
|
|
|
<?php echo GridView::widget([ |
21
|
|
|
'dataProvider' => $dataProvider, |
22
|
|
|
'filterModel' => $searchModel, |
23
|
|
|
'options' => [ |
24
|
|
|
'class' => 'grid-view table-responsive' |
25
|
|
|
], |
26
|
|
|
'columns' => [ |
27
|
|
|
['class' => 'yii\grid\SerialColumn'], |
28
|
|
|
[ |
29
|
|
|
'attribute' => 'level', |
30
|
|
|
'value' => function ($model) { |
31
|
|
|
return \yii\log\Logger::getLevelName($model->level); |
32
|
|
|
}, |
33
|
|
|
'filter' => [ |
34
|
|
|
\yii\log\Logger::LEVEL_ERROR => 'error', |
35
|
|
|
\yii\log\Logger::LEVEL_WARNING => 'warning', |
36
|
|
|
\yii\log\Logger::LEVEL_INFO => 'info', |
37
|
|
|
\yii\log\Logger::LEVEL_TRACE => 'trace', |
38
|
|
|
\yii\log\Logger::LEVEL_PROFILE_BEGIN => 'profile begin', |
39
|
|
|
\yii\log\Logger::LEVEL_PROFILE_END => 'profile end' |
40
|
|
|
] |
41
|
|
|
], |
42
|
|
|
'category', |
43
|
|
|
'prefix', |
44
|
|
|
[ |
45
|
|
|
'attribute' => 'log_time', |
46
|
|
|
'format' => 'datetime', |
47
|
|
|
'value' => function ($model) { |
48
|
|
|
return (int)$model->log_time; |
49
|
|
|
} |
50
|
|
|
], |
51
|
|
|
|
52
|
|
|
[ |
53
|
|
|
'class' => 'yii\grid\ActionColumn', |
54
|
|
|
'template' => '{view}{delete}' |
55
|
|
|
] |
56
|
|
|
] |
57
|
|
|
]); ?> |
58
|
|
|
|
59
|
|
|
</div> |
60
|
|
|
|
61
|
|
|
|
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: