T
T
Theory Theory2020-08-19 06:57:23
Yii
Theory Theory, 2020-08-19 06:57:23

Why doesn't autoload work in yii?

components/Myclass.php:

namespace yii\components;
class Myclass
{
}


models/Site/user.php:
use yii\components\Myclass;
$ob = new Myclass();


As a result
Class 'yii\components\Myclass' not found

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav, 2020-08-19
@Narbek

namespace app\components;
class Myclass
{
}

use app\components\Myclass;
$ob = new Myclass();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question