How to upgrade Yii 1.x to Yii 2.0

元气小坏坏 提交于 2019-12-05 03:26:48

The Yii2 guide has excellent documentation in this regard see Upgrade from v1

I recently migrated couple of moderately complex applications from Yii 1.x to Yii 2.0. There are two ways to go about it , either you can run Yii 1.x and Yii 2 at the same time see using-yii-2-with-yii-1. Then migrate part by part, while it is possible it was quite bit of pain, like trying to rebuild the second floor while living on the third.

Alternatively you can rewrite the entire application bottom up with the exact same functionality, I found this to be much more efficient, significant code could be reused with only minor modifications, also that gave opportunity to tweak the design without changing functionality.

The important thing is to ensure the exposed API ( i.e. the frontend / UI / functionality) remains the same. It is always tempting to update functionality or change features during a rewrite, however if you stick to strictly reimplementing everything for Yii2 then consider changing your API, your migration will be smoother.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!