I was learning Yii framework a few days ago. I facing with the error below:
Fatal error: Class 'Yii' not found in C:\xampp\htdocs\LoginForm\views\user\views\defaultegister.php on line 17
Try this first row:
use Yii;
//other use statements
and then:
Yii::$app->...
OR you can make it work this way to:
\Yii:$app->...
Yii is present in the root folder of the project. So you need to tell the program where to locate it. Either write:
use Yii
at the top along with the other use statements, or put a backslash before Yii like: \Yii