1. Yii2 uses the require() function to import files, but it says that the class cannot be found. Can't it be used this way?
2. If I want to implement the call as shown below, how should I write it?
3. Is there a way to call a folder in Yii2? Yii1 has it. After calling this folder, all the classes and methods contained in this folder can be used.
Supplement: The method in the picture is OK when I use it on ecshop, but the class cannot be found on Yii2.
1. Yii2 uses the require() function to import files, but it says that the class cannot be found. Can't it be used this way?
2. If I want to implement the call as shown below, how should I write it?
3. Is there a way to call a folder in Yii2? Yii1 has it. After calling this folder, all the classes and methods contained in this folder can be used.
Supplement: The method in the picture is OK when I use it on ecshop, but the class cannot be found on Yii2.
Obviously there is a problem with your classpath, use namespaces to deal with it.