Reputation: 189
I am new to Yii 2, Normally I use Yii 1 to develop web application, now Yii have new version of Yii (Yii 2), Do I really need to go for Yii 2? Is there any security risk in Yii 1?
Because as I see Yii 2 is totally changed from Yii 1.
Upvotes: 2
Views: 4994
Reputation: 565
Yes Yii2 is completely different from Yii1. I have migrated old application,i re-write code again. In Yii1 all models loading from main.php file in yii2 you have use namespace where you are using model query. You can get lots of widget for yii2. PHP version also need to update to support Yii2 application. Yii2 is fast compare to Yii1.
Upvotes: 0
Reputation: 89
In terms of security risk, according to Yii official website:
Yii 1.1 will receive critical bugfixes and PHP 7 compatibility fixes till the end of 2016. After that we will only respond to and fix security issues if any will be found until at least the end of 2018. Even after security support has ended, all the code and documentation will be still available.
You should be fine until the end of this year with receiving security updates. After the end of 2018 - you are on your own.
However, if you're going to migrate I suggest you don't continue development on Yii1 framework. Consider running both frameworks together (bridge) and have new development in Yii2 framework. This will give you enough time to rewrite your code. The old Yii1 code can be deprecated and replaced as the new Yii2 code is written.
https://www.yiiframework.com/forum/index.php/topic/58291-yii1-and-yii2-together/
If you want to migrate to Yii2, unfortunately you have to migrate your code. Conceptually Yii1 and Yii2 are quite similar, however Yii2 runs on newer PHP versions and utilizes namespaces, traits etc. Yii2 has also support for dependency injection through $container singleton available after initializing the framework.
Upvotes: 3
Reputation: 21
There are many differences between versions 1.1 and 2.0 of Yii as the framework was completely rewritten for 2.0. As a result, upgrading from version 1.1 is not as trivial as upgrading between minor versions. In this guide you'll find the major differences between the two versions.
Yes, Yii 2 is completely different from Yii 1. The differences are documented pretty well on their site here: http://www.yiiframework.com/doc-...
Upvotes: 2
Reputation: 403
Yes !!, Yii 2 is completely different from Yii 1. There Is Difference in Structure Based: http://www.yiiframework.com/doc-2.0/guide-intro-upgrade-from-v1.html
https://github.com/yiisoft/yii2-app-basic
https://github.com/yiisoft/yii2-app-advanced
Difference In Basic And Advanced
Note: At The End You Have To Go With Yii2 Due To its Advance Advantages:
Upvotes: 9