Answer the question
In order to leave comments, you need to log in
How to import classes in Yii2?
Inside the project, there is a set of classes in the api directory with corresponding namespaces like api\..\ .
When you try to call a static method of a class in a console controller with a connected namespace, an Exception is thrown with a message that the called class does not exist.
In Yii1, this was solved by prescribing the desired directory in the import section of the config file.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question