+1 I like this approach.
Pablo On Mon, Sep 27, 2010 at 12:14 PM, Fabien Potencier < [email protected]> wrote: > On 9/16/10 2:28 AM, Richtermeister wrote: > >> Hi all, >> >> just to chime in, I remember when the 1.1 form framework first came >> out there was some commotion over making it hard to customize forms. >> The usual reply at the time was that the form decorators should only >> be used during prototyping and when one needs manual control over >> layout, fields can just be rendered manually. >> Now, that actually went pretty well I thought, except when it comes to >> embedded forms. There, all fun is over and the pain begins, especially >> when you try one of those ajaxified "add more" embedded forms.. boy >> what a nightmare. Since I usually end up using a partial to render a >> form anyways (which again doesn't work with embedded forms), I'd >> welcome the idea of a native template renderer for forms very, very >> much! Just make sure it works for embedded forms! ;) >> > > One problem with the symfony1.1 form framework was also probably the fact > that many people wanted to keep the <?php echo $form ?> in their templates > as long as possible and be able to customize the layout the way they want > (which is of course not really possible -- or really difficult). > > I was thinking about dropping support for that shortcut in Symfony2. So, > the minimum code you will have to write to render a form would be something > like the following: > > <?php echo $f->errors() ?> > > <table> > <?php echo $f->row('gender') ?> > <?php echo $f->row('object') ?> > </table> > <?php echo $f->hidden() ?> > > <input type="submit" value="Update" /> > > I can see several benefits: > > * we can drop the need for different layout (table, div, ...); > * it is clearer than you have total control on the output; > * no more confusion about the real "value" of echo $form; > * rendering sub-forms is the developer responsibility (with calls to rows() > for instance -- more reflection is needed on this one). > > What do you think? > > Fabien > > > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com 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
