Can I use Yii2's active record with Yii 1.1?

We have a large app developed using Yii 1.1. It has around 300 models and few models have 1000+ lines of code. We plan to refactor these big fat models into sub-models and I was analysing the few patters (single table inheritance, polymorphic assoc, etc).

We are are planning to migrate it to Yii2 sometime (say, 6 months) down the line. I thought of doing this refactoring in the Yii2 so these models so it can leverage new features of Yii2 and also help us to migrate when we had to.

Can we use Yii2’s model into Yii1.1 app?

I would say it could be done via rest/api:

  • you build a new app as rest server connected to the same data

  • use it from the old app

  • refactor the old into the new one

Simple answer is — no. There are complicated ways to do it but I’d not try it since there are more cons than pros in the case.