While trying to include my own class library in Yii
. I used this code to include a class file in Yii
.
Yii::import('application.apis.myapi.*');
myfile lies at [protected/apis/myapi.php]
I don't know I am getting this error:
[YiiBase::include(myapi.php) [<a href='function.YiiBase-include'>function.YiiBase-include</a>]: failed to open stream: No such file or directory]
I think you should import as
Yii::import('application.apis.*');
It will import all php files under directory applications/apis/.
Yii::import('application.apis.myapi'); //only one file
EDIT: also check this question: Yii import functionality
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With