Make Gii accessible via Restful API

(Stefano Mtangoo) #1

Right now you have to use Forms to submit information in Gii. That is good, but it would be better if we could do code generation via an API. That will remove the need for Tools (IDEs et al) to be able to generate things using their own “forms” and just POST to API, than now when you have to use ./yii for generating codes automatically.

Using ./yii in code generation is difficult (you have to manage the launched process on different thread to avoid blocking the UI which adds overhead). Also managing response message especially in case of error is difficult.

My Proposal is:

  1. Move all Gii functionalities to REST API
  2. The current UI should be only a front end to that API

(Alexander Makarov) #2

Do you plan developing Gii plugin for a certain IDE?

(Stefano Mtangoo) #3

Yes. We have our Own IDE that we use for internal development and automating code generation was a nightmare. Only viable option was ./yii and it was a terrible experience since it wasn’t designed with IDE/Autocode generator in mind.

On Other hand we had a nice experience with TernJs simply because it had an API for communication.

To answer your question is Yes. Other IDEs will also benefit.

(Alexander Makarov) #4

Sounds interesting but it certainly isn’t high priority feature. REST API could be added later. Please create an issue in yiisoft/yii-gii not to forget it. Thanks.

(Stefano Mtangoo) #5

Opened ticket: