[development] FAPI's future

Earl Miles merlin at logrus.com
Sat Aug 18 21:53:24 UTC 2007


Khalid Baheyeldin wrote:
> Sorry, coming in late catching up to Emails.
> 
> Regarding what Dries said, it seems we need a form registry
> whether mandatory (declaratory/explicit) or deduced (implicit).
> 
> We seem to already have one that Heine wrote, Form Store:
> http://drupal.org/project/form_store
> 
> There is also Form Corral
> http://drupal.org/project/formcorral
> 
> These may be good starting points ...

Anything that is after the fact will, IMO, not be nearly as useful.

What we want, I believe, is to retool hook_form to work similarly to 
hook_theme. For that matter, I also had a patch that created a hook registry, 
which had some other really interesting effects, but I wasn't convinced there 
was a great deal of performance improvement there, so I didn't work on it 
aggressively. In fact, I did that prior to the theme registry, and decided 
there were massive benefits to the theme version; whereas the hook version had 
pretty minor benefits.

Likewise, a form registry would allow us to do some pretty powerful things with 
forms. For example, automatic registration of theme functions for forms. Right 
now, I predict this is going to be a bit of an issue in Drupal 6, because all 
forms can have theme functions, but only theme functions that actually exist 
can be overridden easily. (It's possible to register them the hard way, it just 
takes more effort on the part of the themer). That's something that can be 
fixed a couple of ways, but registering forms is one way.

It would also allow more advanced form browsing, opening the way for themers to 
use interactive tools to help with forms. That's a HUGE problem in Drupal right 
now; the form api is very, very powerful, and it's completely opaque to people 
whose primary skillset is HTML/CSS.

This is something we should do very early for Drupal 7.




More information about the development mailing list