O'Reilly logo

Drupal 7 First Look by Mark Noble

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Form API changes

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.

New Form API hooks

The Form API has several new hooks that allow you to influence the building and display of forms.

hook_element_info

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required