Yii2 accesing Yii1 models

Hi All,

I have an Yii1 application run on Yii1.1.16 well. Now, I am building an API server using Yii2 Rest merging with Yii1, I have followed some guides in the forum about how to merge Yii1 and Yii2 together. When the program runs, there seems no complaints.

Basic accepting and responding HTTP request seems ok, but I am hitting problem when I want to access the models I have built in Yii1 from the api app (Yii2).

For example, I have a model Customer written in Yii1 syntax, and how do I access this model Customer from Yii2 api app?

Note that my model Customer has no namespace , and I try to use ‘include /path/models/Customer.php’ and seems able to load it, but in Yii2 it complains about:




[Sat Dec 26 19:15:41.174167 2015] [:error] [pid 14852] [client 127.0.0.1:63444] PHP Fatal error:  Class 'app\\modules\\v1\\controllers\\Customer' not found in /.../api/modules/v1/controllers/CustomerController.php on line 73



The conflict could it due to namespace and class loading?