First of all, after using the new form framework for awhile, I can say that for large forms or for forms that require validation, the new form framework is awesome. I really have explored it a lot and have found that it really does tie a lot of the mechanics of form validation together. Very good.
On the other hand, I cannot determine the best way to handle "small forms". For example, I have a "dashboard" which has 3 small forms: - Simple search box and submit button - List of dynamic categories with checkboxes next to them and a "view selected" submit button, - A "filter" form, which filters the dashboard by certain selectable criteria. The first 2 forms post to another action, and the last one posts back to the same dashboard action. I pondered your thoughts about creating straight HTML, but it seems like a step backward. These are so basic, and in the old system i would just create the form via form helpers. IMO it seems to be a bit overkill to have to create all these forms that have very little complexity (i.e. no helps, errors, validation), but I want to stay compliant with the 1.1 direction (i.e. no compat helper). Maybe I should just create the forms on the fly as you suggested? Seems a bit over-complicated though, especially when having to check for them in the post-to actions. What do you think? --ian ----- Original Message ----- From: "Fabien Potencier" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Monday, May 19, 2008 11:14 PM Subject: [symfony-devs] Re: to sfForm or not to sfForm If I understand correctly, I think the best way to handle it is not to use widgets for the HTML and just use a form to validate the submitted value in your action. Fabien Ian wrote: > So I have a form situation and I'm deciding the best way to approach > it. Basically I have a nested set (Doctrine) of product categories. > On this page, I have the ability to delete any category. I also have > 1 form option that goes along with each delete, a checkbox option to > also delete sub-categories (the nested set categories) if they exist. > > So this situation is basically the same small form over and over, > maybe 20+ times. My question is, is it worth it to create a whole > myCategoryDeleteForm() for this small instance? I would have to have X > instances of the same form on the page, and the post validation might > get hairy, especially with how you have to name forms, etc... > > This was easy with the old framework, but now that we have classes to > handle the forms, it may be a better idea to just use straight HTML in > these situations. Any thoughts? > > -- Fabien Potencier Sensio CEO - symfony lead developer sensiolabs.com | symfony-project.com | aide-de-camp.org Tél: +33 1 40 99 80 80 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en -~----------~----~----~----~------~----~------~--~---
