LIAL
LIAL

Reputation: 1634

Is it possible to have one project on one domain and use two frameworks (Yii and Yii2)?

My site was written on Yii framework (v1) and now I would like to start to rewrite it using Yii2. My plan is do it step by step starting from simple, solitary parts.

But I can't understand how can I combine two frameworks in background of my visitors, is it possible at all ? Assuming that I have php 5.4 (or if need 5.5) on server, ONE domain name with no subdomains.

Eg: site has modular structure (it's real so) and have modules: news and articles. I will rewrite news on Yii2 and articles stay using Yii,

mysite.com/news and mysite.com/articles - should show the same as before and visitors shouldn't notice that news uses another framework (url should be the same as before)

Question is: How can I reach it if it's possible ? Is anybody have practical solution or did it in real project ?

Upvotes: 7

Views: 881

Answers (3)

Mihai P.
Mihai P.

Reputation: 9357

Yes it is possible.

You are looking for this link http://www.yiiframework.com/doc-2.0/guide-tutorial-yii-integration.html#using-yii-2-with-yii-1 but you should also take a look at other integrations too. You just have to modify your index.php and that will get you going.

Upvotes: 1

Link
Link

Reputation: 86

If you know how to config url rewrite in nginx or apache , yes, you can .

The essence is match url with regex, base on the difference of url load different index.php of different framework.

Upvotes: 1

ScaisEdge
ScaisEdge

Reputation: 133360

Yes, is possibile, you can install both in a domain. Simply install the Yii1 and Yii2 framework library in two separated sub diretcory.

Inside eg mysite.com/articles the index.php is complaiant for a Yii1 app and inside mysite.com/news the index.php is complaiant for Yii2 app

Upvotes: 0

Related Questions