Open zeebinz opened 12 years ago
Hello @zeebinz ,
I am interested to have a generator that generates Javascript (Backbone.js) models/collections from PHP models.
Primarily, I want this for my module Aurora. I had started to implement something here:
https://github.com/enov/Aurora/blob/master/classes/aurora/aurora/backbone.php
However, instead of writing from scratch, I thought it would be a good idea to use your module, since it seems it is very well written.
It basically needs to iterate over the models that have a RESTful controller, or maybe all the models that are defined in classes/models. Then, it needs to find the "properties" (I have already done this for Aurora). Then it should write to DOCROOT . 'assets/js/models', or any other configurable path.
Can you shed some light, or maybe point some direction, how can I achieve this using your module?
I want either:
I hope I was clear :)
Thank you for this module :)
Samuel
Always happy to oblige, if it can be done. Could you Gist an example command and expected output in the fixtures format like this one, with an example model class for the tests, and I'll see what I can do.
@zeebinz ,
Thank you for the quick reply.
Basically, what I am asking is this:
https://gist.github.com/enov/fa986691effac3ae22a8
However, now that I am thinking more and more, I am becoming greedy :) So I think my ultimate goal will be something like this:
https://gist.github.com/enov/d555ba8d44589bd3cfb4
Now, I am not expecting you to do all this for me, as this is probably opinionated and your module is more generic. However, I am definitely asking for guidance. I am skimming through the docs and it seems your module is very extendable.
Thank you again for your support and for this module. Any hint is much appreciated.
Samuel
If you want any new generators to be added, just add a comment in here or create a new issue. Pull requests are also welcome. :)