On 19.06.2011 20:30, victor berchet wrote: > 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 ?
I just think this is highly unreadable due to the nesting of objects and with their enforced quotes and such it's really verbose. The way you put it gave me an idea though, but I'm not sure if it's a good one ;) We could actually namespace the property names, and really use: {"label.text": "foo", "label.attr": {"class":"bla"}, "widget.attr": {"class":"bar"} I think it makes it a bit more readable due to less nesting. 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