How to use the Drupal 7 form API without Drupal?
I really like the way the Drupal form API is conceived. I have never been blocked by the API even with v开发者_开发技巧ery high marketing expectations on subtle form features.
I have started developing a small PHP form class that mimics this API in order to use it in small projects that do not require a full fledge Drupal installation.
Nevertheless, I would be far more satisfied if I could extract some files of Drupal, perhaps make some light, automatic modifications on them, and generate this lightweight form validation library.
Do you think it is possible? Has it already been done?
Thank you for your help.
The form system depends on the render/theme API (drupal_render()/theme() and everything related), the hook system, the database layer (form_state cache) and probably a lot more.
I think it is highly unlikely that you will be able to use it separately from Drupal.
Maybe you could build a system that uses the same API but I'm not sure if it is worth it.
There are some discussions about re-designing it, maybe that would be more separated, like the new database layer in Drupal 7.
精彩评论