Issues (10)

src/views/default/app/index.php (1 issue)

Severity
1
<?php
2
3
use yii\helpers\Html;
4
use yii\grid\GridView;
5
use yii\widgets\Pjax;
6
7
/* @var $this yii\web\View */
8
/* @var $dataProvider yii\data\ActiveDataProvider */
9
10
$this->title = Yii::t('app', 'Apps');
11
$this->params['breadcrumbs'][] = $this->title;
12
?>
13
<p>
14
    <?= Html::a('添加', ['create'], ['class' => 'btn btn-success']) ?>
15
</p>
16
<div class="app-index">
17
18
    <?= GridView::widget([
19
        'dataProvider' => $dataProvider,
20
        'columns' => [
21
            ['class' => 'yii\grid\SerialColumn'],
22
23
            'id',
24
            'app_name',
25
            'app_description',
26
            [
27
                'attribute' => 'num',
28
                'format' => 'html',
29
                'value' => function ($model) {
30
                    return $model->getNum($model->id);
31
                }
32
            ],
33
            // 'app_key',
34
            // 'app_secret',
35
            // 'created_at:datetime',
36
            // 'updated_at:datetime',
37
            // 'status
38
            ['class' => 'yii\grid\ActionColumn',
39
            'template' => '{view} {update} {delete} {applog}',
40
            'buttons' => [
41
            'applog' => function ($url, $model, $key) {
0 ignored issues
show
The parameter $key is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

41
            'applog' => function ($url, $model, /** @scrutinizer ignore-unused */ $key) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
42
                $appId = $model->id;
43
                $url = \yii\helpers\Url::to(['app-log/index', 'app_id' => $appId]);
44
                return Html::a("访问日志", $url);
45
            }
46
            ]
47
            ],
48
        ]
49
    ]); ?>
50