Jordi, The thing is label already accepts "{ label: 'foo', attr: {"label": "fallbackfoo", ...} }" and widget accepts "{ attr: {...} }" when rendering.
And then we can use the "attr" as attributes of the the row (the <div> tag) so it would be: render_row(form.field, {"label": {"label":"foo", "attr": {"class":"labelbla"}}, widget: {"attr": "widgetbla" }, "attr": {"class": "rowbla"}}) LABEL: label.label would be use when provided, otherwise label.attr.label would be use if provided otherwise the default label would be use. WIDGET: the widget value would be used as options when rendering the widget, ROW: the attr would be used to render the container attributes on the row. What do you think ? Cheers, Victor On Jun 19, 1:12 pm, Jordi Boggiano <j.boggi...@seld.be> wrote: > On 18.06.2011 11:10, victor berchet wrote: > > > Jordi (and Stof), > > > What you propose is a good solution, it would be: > > > render_row($form, {label: { label: 'foo', attr: {...} }, widget: > > { attr: {...} }}) > > > so that when rendering a row you are able to override both the label > > and the widget option independently. > > I'll work on that. > > > I have pushed a 'form/theming' branch to my repo if you want a preview > > of the rendering refactoring. > > Note that what I suggested was to use sub-keys for label and error, but > anything at the top-level would go to the widget, because that's the > mostly used case I'd guess, and the nesting is really quite annoying. > > Similarly it could be nice if just passing {"label":"foo"} would be > detected and converted to {"label":{"label":"foo"}} automatically, > because it's a common use case, and the expanded version is quite ugly. > > e.g.: > > render_row(form.field, {"label": "foo", "attr": {"class": "bla"}}) > > Specifies a label text, and an extra class on the widget > > render_row(form.field, {"label": {"label":"foo", > "attr":{"class":"labelbla"}}, "attr": {"class": "bla"}}) > > Specifies a label text, an extra class on both widget and label. > > Cheers > > -- > Jordi Boggiano > @seldaek -http://nelm.io/jordi -- 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 symfony-devs@googlegroups.com To unsubscribe from this group, send email to symfony-devs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en