2

Have a running Yii1 application. How to enhance Yii1 application with Yii2 restfull api instead of rewriting the whole Yii1 application in Yii 2?

1 Answers1

2

You can work with two separate application or with a yii2 and yii1 application integrated . see this doc for details.

Essentially you must install Yii 2 in your existing application and modify the entry script of the application as indicated in the doc , Because both Yii 1 and Yii 2 have the Yii class, you should create a customized version to combine them.

Once you have your yii2 application you can call the services you need here you can find a quick start guide for restful webservices in yii2

ScaisEdge
  • 131,976
  • 10
  • 91
  • 107
  • After integration, correct steps to use only yii2 Restfull in yii1? Create Yii2 app/common and app/rest. Gii generate relevant models. For REST will be used Yii2, everything else will remain on Yii1. In Yii2 even do not need anything complex: 1.Gii model POST 2. Create a simple controller Rest for the model "post" is ready. Available on https://your-url-server.local/rest/web/index.php?r=posts (GET POST PUT DELETE) – user3118624 Nov 08 '15 at 17:16
  • Need to merge yii1 and yii2 model or yii1 will understand yii2 model? – user3118624 Nov 08 '15 at 17:29