Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Gii accessible via Restful API #15

Closed
mtangoo opened this issue Jul 3, 2019 · 8 comments
Closed

Make Gii accessible via Restful API #15

mtangoo opened this issue Jul 3, 2019 · 8 comments
Assignees
Labels
type:feature New feature

Comments

@mtangoo
Copy link

mtangoo commented Jul 3, 2019

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

The Topic was discussed here before this issue was opened

@samdark samdark added the type:feature New feature label Jul 3, 2019
@samdark
Copy link
Member

samdark commented Jul 3, 2019

What would API look like?

@mtangoo
Copy link
Author

mtangoo commented Jul 3, 2019

Well the same information that Gii sends as form but in JSON format. Am not sure what is going to change in Gii with Yii3, but whatever is sent via the form should be possible with JSON payload

@samdark
Copy link
Member

samdark commented Jul 3, 2019

Am not sure what is going to change in Gii with Yii3

Not much conceptually. Gii is a very well done part of Yii 2.

@mtangoo
Copy link
Author

mtangoo commented Jul 3, 2019

I think It will be JSON Payload of what is send as form-data right now. I'm not sure how to not duplicate the backend so that the form-data and JSON Payload will share same backend

@samdark
Copy link
Member

samdark commented Jul 3, 2019

That could be done if frontend is using REST API.

@rustamwin rustamwin self-assigned this Apr 24, 2022
@ahmadasjad
Copy link
Contributor

Currently, we are already using the REST API to generate the code. The requirement for this issue is resolved.

FYI: @samdark

@mtangoo
Copy link
Author

mtangoo commented Sep 25, 2024

@ahmadasjad can you explain how? I have not dived too much into Yii3 yet, but would love to check how it currently works

@samdark samdark closed this as completed Sep 25, 2024
@samdark
Copy link
Member

samdark commented Sep 25, 2024

Thanks, @ahmadasjad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature
Projects
None yet
Development

No branches or pull requests

4 participants