Issues (33)

views/layouts/main.php (7 issues)

1
<?php
2
3
/** @var yii\web\View $this */
4
/** @var string $content */
5
6
use app\assets\AppAsset;
7
use app\widgets\Alert;
8
use yii\bootstrap5\Breadcrumbs;
9
use yii\bootstrap5\Html;
10
use yii\bootstrap5\Nav;
11
use yii\bootstrap5\NavBar;
12
13
AppAsset::register($this);
14
15
$this->registerCsrfMetaTags();
16
$this->registerMetaTag(['charset' => Yii::$app->charset], 'charset');
0 ignored issues
show
The property charset does not seem to exist on __Application.
Loading history...
17
$this->registerMetaTag(['name' => 'viewport', 'content' => 'width=device-width, initial-scale=1, shrink-to-fit=no']);
18
$this->registerMetaTag(['name' => 'description', 'content' => $this->params['meta_description'] ?? '']);
19
$this->registerMetaTag(['name' => 'keywords', 'content' => $this->params['meta_keywords'] ?? '']);
20
$this->registerLinkTag(['rel' => 'icon', 'type' => 'image/x-icon', 'href' => Yii::getAlias('@web/favicon.ico')]);
0 ignored issues
show
The method getAlias() does not exist on Yii. ( Ignorable by Annotation )

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

20
$this->registerLinkTag(['rel' => 'icon', 'type' => 'image/x-icon', 'href' => Yii::/** @scrutinizer ignore-call */ getAlias('@web/favicon.ico')]);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
21
?>
22
<?php $this->beginPage() ?>
23
<!DOCTYPE html>
24
<html lang="<?= Yii::$app->language ?>" class="h-100">
0 ignored issues
show
The property language does not seem to exist on __Application.
Loading history...
25
<head>
26
    <title><?= Html::encode($this->title) ?></title>
27
    <?php $this->head() ?>
28
</head>
29
<body class="d-flex flex-column h-100">
30
<?php $this->beginBody() ?>
31
32
<header id="header">
33
    <?php
34
    NavBar::begin([
35
        'brandLabel' => Yii::$app->name,
0 ignored issues
show
The property name does not seem to exist on __Application.
Loading history...
36
        'brandUrl' => Yii::$app->homeUrl,
0 ignored issues
show
The property homeUrl does not seem to exist on __Application.
Loading history...
37
        'options' => ['class' => 'navbar-expand-md navbar-dark bg-dark fixed-top']
38
    ]);
39
    echo Nav::widget([
40
        'options' => ['class' => 'navbar-nav'],
41
        'items' => [
42
            ['label' => 'Home', 'url' => ['/site/index']],
43
            ['label' => 'About', 'url' => ['/site/about']],
44
            ['label' => 'Contact', 'url' => ['/site/contact']],
45
            Yii::$app->user->isGuest
0 ignored issues
show
The property isGuest does not seem to exist on __WebUser.
Loading history...
46
                ? ['label' => 'Login', 'url' => ['/site/login']]
47
                : '<li class="nav-item">'
48
                    . Html::beginForm(['/site/logout'])
49
                    . Html::submitButton(
50
                        'Logout (' . Yii::$app->user->identity->username . ')',
51
                        ['class' => 'nav-link btn btn-link logout']
52
                    )
53
                    . Html::endForm()
54
                    . '</li>'
55
        ]
56
    ]);
57
    NavBar::end();
58
    ?>
59
</header>
60
61
<main id="main" class="flex-shrink-0" role="main">
62
    <div class="container">
63
        <?php if (!empty($this->params['breadcrumbs'])): ?>
64
            <?= Breadcrumbs::widget(['links' => $this->params['breadcrumbs']]) ?>
65
        <?php endif ?>
66
        <?= Alert::widget() ?>
67
        <?= $content ?>
68
    </div>
69
</main>
70
71
<footer id="footer" class="mt-auto py-3 bg-light">
72
    <div class="container">
73
        <div class="row text-muted">
74
            <div class="col-md-6 text-center text-md-start">&copy; My Company <?= date('Y') ?></div>
75
            <div class="col-md-6 text-center text-md-end"><?= Yii::powered() ?></div>
0 ignored issues
show
The method powered() does not exist on Yii. ( Ignorable by Annotation )

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

75
            <div class="col-md-6 text-center text-md-end"><?= Yii::/** @scrutinizer ignore-call */ powered() ?></div>

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
76
        </div>
77
    </div>
78
</footer>
79
80
<?php $this->endBody() ?>
81
</body>
82
</html>
83
<?php $this->endPage() ?>
84