Now that we have reviewed the changes to the menu system, let's look at changes to the Form API. There are several new methods in Drupal 7 that make it easier to work with Drupal forms as well as making forms more powerful.
The Form API has several new hooks that allow you to influence the building and display of forms.
hook_element_info()
This hook allows you to define additional element types that should become available for use within the Form API. The return value of this API is an associative array containing information about the element to be defined. For a complete list of keys that should be provided, see the online documentation at: http://api.drupal.org/api/function/hook_element_info/7.
This hook is derived from the Drupal 6 hook_elements
method. If you used hook_elements
in your Drupal 6 modules, you can convert the module to use hook_element_info
in Drupal 7.