You are here

function _webform_view_field_component in Webform 7.4

Fix the view field(s) that are automatically generated for number components.

Provides each component the opportunity to adjust how this component is displayed in a view as a field in a view table. For example, a component may modify how it responds to click-sorting. Or it may add additional fields, such as a grid component having a column for each question.

Parameters

array $component: A Webform component array.

array $fields: An array of field-definition arrays. Will be passed one field definition, which may be modified. Additional fields may be added to the array.

Return value

array The modified $fields array.

Related topics

File

./webform.api.php, line 1379
Sample hooks demonstrating usage in Webform.

Code

function _webform_view_field_component(array $component, array $fields) {
  foreach ($fields as &$field) {
    $field['webform_datatype'] = 'number';
  }
  return $fields;
}