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 defaults

Now that we have Webform aware of our new IMEI component we can define the attributes of the component itself. These are, for the larger part, the attributes we specify values for on our component edit page which will affect how the component is rendered and also how our users interact with it.

This function and many of the others that follow are not bona fide Drupal hooks, although they operate similarly. They provide an internal integration methodology between Webform and its components via a callback system.

How to do it...

Let's add the component defaults function to our component module file, webform_imei.module as follows:

/** * Implements _webform_defaults_component(). */ function _webform_defaults_imei() { return ...

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