M
M
MSAFT2019-01-28 11:27:14
Yii
MSAFT, 2019-01-28 11:27:14

Yii2 does not find the class and does not define variables, what could be the problem?

I have a Yii2 project that I'm trying to reproduce locally. I set everything up, when I open the main page of the site it gives out:
Class 'Html' not found
Namespace is registered and working, PHPStorm does not highlight in any way: View code:
use yii\helpers\Html;

<li role="presentation" class="active">
            <?= Html::a(
                Html::tag('span', '', ['class' => 'gticon_palm2']) .
                Html::tag('strong', Yii::t('app', 'Текст')),
                '#tours', [
                    'aria-controls' => 'tours',
                    'role' => 'tab',
                    'data-toggle' => 'tab',
                    'title' => Yii::t('app', 'Текст'),
                    'class' => 'js-typing-update',
                    'data-typing-static' => Yii::t('app', 'Заголовок'),
                    'data-typing-dynamic' => Yii::t('app', 'текст')
                ]
            ) ?>
        </li>

If you write it like this: It
<?= yii\helpers\Html::a(
will work, but it will start swearing at an undeclared variable (which is declared), and so on on all pages.
I thought the problem was in the PHP version, since on the production server PHP5.6, and I have 7.2 on the local, I downgraded to the desired version on the local, but the problem has not changed.
What could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question