O'Reilly logo

Drupal 7 Webform Cookbook by Douglas Vernon Denny

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

Defining component features

Our first step towards defining our component to Webform is hook_webform_component_info(). In this hook we give our component a name, a description, and a list of Webform features we would like to enable or disable.

Getting ready

Using our favorite text editor, let's open our module file for editing so that we may start the process of defining our new Webform component.

How to do it...

When we utilize a hook we must be careful to rename the function according to our module name. With that in mind, let's add the following code to the new webform_imei.module file we created previously:

/** * Implements hook_webform_component_info(). */ function webform_imei_webform_component_info() { $components = array(); $components['imei'] ...

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