These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | use hiqdev\themes\hyde\widgets\LinkPager; |
||
4 | use yii\helpers\Html; |
||
5 | use yii\widgets\ListView; |
||
6 | |||
7 | $this->title = Yii::$app->name; |
||
8 | |||
9 | ?> |
||
10 | |||
11 | <?php if ($dataProvider) : ?> |
||
12 | <?= ListView::widget([ |
||
13 | 'layout' => "{items}\n{pager}", |
||
14 | 'options' => [ |
||
15 | 'class' => 'posts', |
||
16 | ], |
||
17 | 'itemOptions' => [ |
||
18 | 'class' => 'post', |
||
19 | ], |
||
20 | 'dataProvider' => $dataProvider, |
||
21 | 'pager' => [ |
||
22 | 'class' => LinkPager::class, |
||
23 | 'prevPageLabel' => Yii::t('hiqdev:com', 'Newer'), |
||
24 | 'nextPageLabel' => Yii::t('hiqdev:com', 'Older'), |
||
25 | ], |
||
26 | 'itemView' => function ($model, $key, $item, $widget) { |
||
0 ignored issues
–
show
|
|||
27 | $out = Html::tag('h1', Html::a($model->title, ['/pages/render/index', 'page' => $model->path]), ['class' => 'post-title']); |
||
28 | $out .= Html::tag('span', date('Y-m-d', strtotime($model->date)), ['class' => 'post-date']); |
||
29 | |||
30 | return $out . $model->render(); |
||
31 | }, |
||
32 | ]) ?> |
||
33 | <?php endif ?> |
||
0 ignored issues
–
show
It is not recommended to use PHP's closing tag
?> in files other than templates.
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore. A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.
Loading history...
|
|||
34 | |||
35 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.