简体   繁体   中英

Should custom form module in drupal be a node type?

I just started to develop a new module in Drupal. The goal of the module is to capture user's data (purely CRUD). I had been using CakePHP so far and now planning to switch to Drupal.

I am using Drupal's Form API to create a form page.I have almost completed 'Create' operation. I have a few of questions before I go too far.

  1. Should this form be a Drupal's content/node type?
  2. Can I reuse the 'Create' source for 'Update' operation? (like in CakePHP)?
  3. How does the permissions work with this kind of module?

PS: My form is highly customized so I am not up for using CCK/Views. And, I am also very confused after doing some CakePHP. I keep relating CakePHP and Drupal. :/

These examples are nice thing to start:

  1. If you form don't work with nodes, it willn't. Otherwise investigate *node_example* and *nodeapi_examples*.
  2. Yes, you should send argument via menu definition, that identify ID and load it from DB. After this assign loaded values to #default_value . So http://site.com/YOURFORMPATH will used for creation, http://site.com/YOURFORMPATH/ID for updating/deleting.
  3. See *menu_example* how menu defined with permissions. and define for your "YOURFORMPATH" menu item.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM