Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've had a request for a component that creates the code for an admin configuration form, so:
- hook_menu()
- menu item definition in hook_menu()
- a form builder in MODULE.admin.inc
- form validation handler
- form submit handler, using system_settings_form()
- line in .info file giving the config path
That's going to be tying quite a few components together, as we need to:
- force hook_menu()
- add to hook_menu()'s code
- add a line to the .info file
Fortunately, we already have .info files made last IIRC. For hook_menu(), some replumbing may be necessary!
Comments
Comment #1
joachim CreditAttribution: joachim commentedFor this, we also need to #2062085: rethink module generator 'requested_build' property.
Comment #2
duckydan CreditAttribution: duckydan commentedThis would be so great to have!!!
Comment #3
joachim CreditAttribution: joachim commentedDone!
This is in the UI as a new checkbox.
I still need to document this in drush, but it's: 'drush mb foo settings_form!'