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.
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.
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'] = array( 'label' => t('IMEI'), 'description' => t('IMEI number type.'), 'features' => array( 'csv' => TRUE, 'email' => TRUE, 'email_address' => FALSE, 'email_name' => FALSE, 'required' => TRUE, 'conditional' => TRUE...