HasMany and HABTM Plugin (View Layer)

Is there any plugins like Rails Gem Cocoon for CakePHP?
I am really interested in building a plugin like this or contribute to one that already exists. So here are some questions about the plugin:

  • How difficult would it be to develop a plugin like that?
  • From where can I start?
  • Is there any similar plugin to Cocoon?

I have never used Cocoon, could yo explain briefly what it does?

A brief look at it makes me think that it’s something like Crud+CrudView. I might be wrong though.

Cocoon automatically handles HasMany and HABTM forms. The functioning process goes like this:

Suppose you’re developing a project manager and a Project HasMany Issues

  1. You load the gem (and its assets).
  2. When you are writing the form for a new Project if you write a input for Issues the Cocoon gem will proxy the call of Rails form builder and will create inputs for Issues with all the fields of the model (e.g. IssueName, IssuePriority, IssueReporter) and also will create an “+” button to add new issues and a “-” button in each issue to remove it (yes, it is that magical).
  3. Since the input names are in the format that the controller expect them to be the data is saved without any problem and even is validated.

The final look of it is something like this (in this case an Article HasMany References):