Module Development

Creating a Configuration Settings Form for Your Module for Drupal 7

Check your version

This tutorial covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Alternate resources

Sprout Video

This video goes through the process of creating a configuration form in order to save settings to the variables table in the database, and how to integrate those variables into your module.


The $item array in the function demo_menu() should be named $items, to match the return $items; line. (Either that or return $items; should be fixed to return $item;.) Just make sure the array you are building matches the name of the variable you are returning.

Form validation in Drupal