[development] Implementing without nodes

Derek Wright drupal at dwwright.net
Wed Dec 19 00:55:41 UTC 2007


On Dec 18, 2007, at 4:45 PM, Feijó Legendas wrote:

> Every site about hook_form, uses node! Can I do that without nodes?

Yes.  hook_form() is specific to modules that implement their own  
node types.  You don't want that.  What you want is to read the  
documentation about the Forms API (FAPI) and define your own form  
builder function, validation routine, submit handler, etc.  Then, you  
can just use hook_menu() to serve up this form at a specific menu  
location.

http://api.drupal.org is your friend.

Also, just search in core for hook_menu implementations that use  
"drupal_get_form" as the menu callback, and you'll find dozens  
(hundreds?) of examples.

Good luck,
-Derek (dww)





More information about the development mailing list