[development] Table hook idea

Gordon Heydon gordon at heydon.com.au
Thu Nov 8 05:42:02 UTC 2007


Hi,

Earl Miles wrote:
> Gordon Heydon wrote:
>> Hi,
>>
>> Once drupal 6 is out I am going to be continuing my development of
>> merging theme(table) to the formapi. I have gotten the #pre_render into
>> the formapi so that we can generate the table from a drupal_render().
> 
> I am really against merging theme('table') and formapi for two reasons:

Merging theme('table') is not really the right words for it. None of
theme('table') will be put into the fapi, but more just the ability to
create the structure of the table and then the default fapi themes will
format it.

> 1) I've already written that theme('table') is harmful to themers, in
> general. I want to see less use of it, not more.

I agree, theme('table') is a real pain, and I want it gone. Something as
simple as a 3rd party module adding an additional column or changing a
cell is completely beyond it. And the fact that a lot of system forms
that have a theme functions just to run the form into a table is a pain.
If I need to theme these forms, I just want to do the bare minimum, not
recreate the entire form.

> 2) I feel very strongly that we do *too* much display-oriented work in
> fapi and we need to do less. We need to separate that work, not combine
> it more. Yes, we need to do it in such a way that we retain the power
> that we have, but right now we are giving the module developer power at
> the expense of the themer. This is a trend I am actively attempting to
> reverse.

Agreed. You should be able to create/describe the structure of table in
the form, and then a theme function can just theme it. It would even be
quite conceivable that people may just want to change the theme for the
elements that make up the table.

Gordon.


More information about the development mailing list