Yes, Bernhard is right. To expand on that, it's really a mistake to
have rowAttributes, labelAttributes, etc. as I first suggested,
because it's very verbose and if you use CSS intelligently you don't
need more than just attributes set on the row container (<li> or <tr>
depending on decorator):
.special-row label {
CSS for label
}
.special-row input {
CSS for widget
}
.special-row {
CSS for container itself
}
There's a backwards compatibility issue here, but it's backwards
compatible with something pretty tough to use in any effective way. (:
If we must be backwards compatible, then please give us a
special-cased attribute 'row-class' that sets the class of the row
rather than the widget. That would be a lot less tedious than four
levels of arrays. And HTML has no row-class attribute, so there's no
conflict there.
On Thu, Feb 5, 2009 at 10:19 AM, Bernhard Schussek <[email protected]> wrote:
>
> Hi Tom,
>
> 2009/2/5 Tom Boutell <[email protected]>:
>> I believe ->render() and ->renderRow() would be much more useful if
>> they accepted attributes intended for the formatting element that
>> contains the row, not just the attribute itself.
>
> I absolutely agree. If I use the method renderRow(), I am abstracting
> on a row-based level and I want to influence the attributes for the
> row. This is why I think passing the attributes given to renderRow()
> to the <tr> tag only would be fine.
>
> If I want to tune the attributes for the single widget, I can still
> render it individually.
>
> Example:
>
> $form['email']->renderRow(array('class' => 'foobar'));
> <tr class="foobar">...</tr>
> vs.
> $form['email']->render(array('class' => 'foobar'));
> <input class="foobar" ... />
>
>
> Bernhard
>
> >
>
--
Tom Boutell
www.punkave.com
www.boutell.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
-~----------~----~----~----~------~----~------~--~---