This 2 parts tutorial will show you how we came up with a new symfony sfForm widget to handle many-to-many relationships. In our specific case, existing widgets for such relationships were found extremely unuser-friendly to say the least, we had to think about a new widget to help our users in their daily operation.
We do not pretend that our solution is the best in all user-cases but it is definitively a better approach when you have a lot of potential items to associate with your current object and a short list of associated items; the relationship between a classroom and students for example: you have a class of students (the class is less than 40 students usually) within a University of thousands of students.
Finally! We finally managed to catch up and prepare a new version of our Symfony plugin to generate nice admin generator based on jQuery UI Themes.
We tagged this version as 0.2.0 since we still consider this plugin as beta version (but usable on production) but the big news is the support of symfony 1.4! For this specific support I must thank you 2 people that submited 2 patches to make this compatibility possible. Thanks to ( jtexier , “merci Jerome ”) and dalexandre and of course I must named jeremyb for his dedication to the project, he did most of the latest development.
I also setup a live demo to allow you to play a little bit with the plugin. It is currently basic but we will add more stuff step by step.
- Theme switcher integrated
- user interface fixes and enhancements
- Symfony 1.4 compatibility
You can have some more details on my previous post.
The plugin is available as usual on github, I will publish as well the packaged plugin on symfony website.
I have finally released a new version of this plugin with an unpronounceable name Here is the list of change:
- I add a new field named ‘show’ for the admin generator. I guess the meaning of this new option is quite obvious, isn’t it? It add the possibility to simply view one object details without editing it. It currently shows the list of fields like it is for the ‘edit’ view, meaning with a tab interface.
- I also create a new class jRollerDoctrineGenerator to replace sfDoctrineGenerator if you want the default link (the one you create with the = sign before the field name in the generator.yml) to link to the ‘show’ view rather than by default going to the ‘edit’ view. So far this is the only added value of this class. Of course if you prefer to keep the link to the ‘edit’ view simply keep the default class sfDoctrineGenerator. To use it, you simply need to modify your generator.yml as followed:
The source code is available on github for the moment (http://github.com/gestadieu/sfAdminThemejRollerPlugin/tree/master), I want to finalize a few things before packaging a new plugin version. I also need to put the source code on svn.
I have just released the version 0.1.3 of the symfony plugin named (take a deep breath “sfAdminThemejRollerPlugin”. I fixed a few inconsistency and allow to change to your own theme without the need to install your own version of jQuery and jQuery UI. Within the plugin there is only one theme named “redmond” (what a bad idea to name a theme like this but you can download one from jqueryui.com and install it on your own web directory (see README file).
I have also uploaded it to github.com and to the official symfony svn repository.
Taste it and enjoy it!