E
E
edik892016-10-24 15:02:02
Yii
edik89, 2016-10-24 15:02:02

What is the error "The use statement with non-compound name 'Yii' has no effect"?

Deployed a new server, uploaded a yii2 project. On some pages I see the error The use statement with non-compound name 'Yii' has no effect. For example, in a view file I use the following construction:

<?php
use Yii;
use yii\helpers\Html;
use yii\helpers\Url;

Swears on use Yii. PHP version PHP 5.4.45. Fulfilled php requirements.php like all the requirements are met. On another server, a similar project works without problems. What can be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Максим Федоров, 2016-10-24
@edik89

Ошибка возникает из за того что в файле с представлением по умолчанию подключен Yii, а Вы его повторно пытаетесь подключить. Подразумеваю что в остальных местах где у Вас появляется такая ошибка - аналогичная ситуация

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question